@@ -14,7 +14,7 @@ Installation
14
14
15
15
or in your plugins directory :
16
16
17
- $ svn co http://svn.symfony-project.com/plugins/sfEasyGMapPlugin sfEasyGMapPlugin
17
+ $ svn co http://svn.symfony-project.com/plugins/sfEasyGMapPlugin/branches/v3 sfEasyGMapPlugin
18
18
19
19
* Optional: enable the sample module in your `settings.yml`: sfEasyGMapPlugin
20
20
@@ -95,101 +95,12 @@ Examples
95
95
<?php include_map_javascript($gMap); ?>
96
96
97
97
98
- * Sample 3
99
-
100
- * change the map center location and the zoom level
101
-
102
- * change the zoom and movement controls used
103
-
104
- * store the markers' javascript objects in a javascript array
105
-
106
- * use a custom icon for the markers
107
-
108
- * bind event listeners to the markers linked to custom javascript functions
109
-
110
- * add custom property to the markers' javascript objects
111
-
112
- * In the action:
113
-
114
- // parameters: zoom level, lat, lng, options
115
- $this->gMap = new GMap(
116
- array(
117
- 'zoom'=>4,
118
- 'center_lat'=>45,
119
- 'center_lng'=>8,
120
- 'control'=>'new google.maps.SmallMapControl()'
121
- )
122
- );
123
-
124
- // some places in the world
125
- $coordinates = array(
126
- array(51.245475,6.821373),
127
- array(46.262248,6.115969),
128
- array(48.848959,2.341577),
129
- array(48.718952,2.219180),
130
- array(47.376420,8.547995)
131
- );
132
-
133
- // adds a variable "markers" defined on the global level
134
- $this->gMap->addGlobalVariable('markers','new Array()');
135
-
136
- // creates a custom icon for markers
137
- $gMapIcon = new GMapIcon(
138
- 'nice_icon',
139
- '/sfEasyGMapPlugin/images/nice_icon.png',
140
- array(
141
- 'width'=>18,
142
- 'height'=>25,
143
- 'info_window_anchor_x'=>9,
144
- 'info_window_anchor_y'=>25
145
- )
146
- );
147
-
148
- // creates two custom event listeners
149
- $gMapEvent1 = new GMapEvent(
150
- 'mouseover',
151
- "document.getElementById('console_div').innerHTML = 'Mouse over marker number '+this.num;"
152
- );
153
- $gMapEvent2 = new GMapEvent(
154
- 'mouseout',
155
- "document.getElementById('console_div').innerHTML = '';"
156
- );
157
-
158
- foreach ($coordinates as $key=>$coordinate)
159
- {
160
- // parameters: lat, lng, marker's javascript object's name, icon object
161
- $gMapMarker = new GMapMarker($coordinate[0],$coordinate[1],'markers['.$key.']',$gMapIcon);
162
- $gMapMarker->addHtmlInfoWindow('<b>Coordinates:</b><br />'.implode(', ',$coordinate));
163
- // will add a custom property to the marker's javascript object
164
- $gMapMarker->setCustomProperty('num',$key);
165
- // binds the event listeners to the marker
166
- $gMapMarker->addEvent($gMapEvent1);
167
- $gMapMarker->addEvent($gMapEvent2);
168
-
169
- $this->gMap->addMarker($gMapMarker);
170
- }
171
-
172
- * In the template:
173
-
174
- <?php use_helper('Javascript','GMap') ?>
175
-
176
- <?php include_map($gMap,array('width'=>'512px','height'=>'400px')); ?>
177
-
178
- Search on the map:
179
- <?php include_search_location_form() ?>
180
- <br />
181
- <br />
182
- <div id="console_div" style="font-size:large"></div>
183
-
184
- <!-- Javascript included at the bottom of the page -->
185
- <?php include_map_javascript($gMap); ?>
186
-
187
-
188
98
189
99
TODO
190
100
----
191
101
192
- * make the javascript more compact
193
102
* correct javascript files that suppose that the map's javascript object is called 'map'
194
103
* add support for EncodedLines
195
104
* add support for custom zoom and move controls
105
+ * add support for Directions
106
+ * add support for Labeled markers
0 commit comments