Changeset 5062 for extensions/edit_gmaps/admin
- Timestamp:
- Mar 6, 2010, 5:33:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/admin_edit.tpl
r4558 r5062 157 157 {literal} 158 158 //<![<!--CDATA[ 159 160 var controleMiniCarte ; 161 function ajoutControle(newZoom){ 162 163 if (newZoom < 5) return ; 164 165 var vt1=typeof(controleMiniCarte) ; 166 if (vt1=="undefined" ) { 167 168 controleMiniCarte = new google.maps.OverviewMapControl(new google.maps.Size(300,200)); 169 controleMiniCarte.setMapType(G_PHYSICAL_MAP); 170 map.addControl(controleMiniCarte); 171 172 } 173 } 159 174 function onLoad() 160 175 { … … 162 177 var mapElement = document.getElementById("map"); 163 178 var map = new GMap2(document.getElementById("map"),{mapTypes: [G_SATELLITE_MAP,G_HYBRID_MAP,G_NORMAL_MAP,G_PHYSICAL_MAP,G_SATELLITE_3D_MAP]}); 164 165 map.addControl(new GLargeMapControl());179 map.addControl(new GLargeMapControl3D()); 180 166 181 map.addControl(new GMapTypeControl()); 167 182 map.addControl(new GScaleControl()); … … 177 192 178 193 map.setCenter( coord, echelle); 179 var marker = new GMarker(coord); 194 195 var marker = new GMarker(coord, {ldelim} draggable: true}); 196 197 198 180 199 map.addOverlay(marker); 181 200 … … 185 204 try { 186 205 // the overview must be added after setting map center 187 var ovcontrol = new GOverviewMapControl(new GSize(165,165)); 188 map.addControl(ovcontrol); 189 var ov_map = ovcontrol.getOverviewMap(); 206 //var ovcontrol = new GOverviewMapControl(new GSize(165,165)); 207 //map.addControl(ovcontrol); 208 209 // var ov_map = ovcontrol.getOverviewMap(); 210 GEvent.addListener(map, "zoomend", function() { 211 var newZoom = map.getZoom(); 212 ajoutControle(newZoom); 213 } ); 190 214 GEvent.addListener(map, 'maptypechanged', function(){ 191 ov_map.setMapType(G_NORMAL_MAP); 215 216 if (typeof(controleMiniCarte)=="undefined" ) return; 217 var ov_map = controleMiniCarte.getOverviewMap(); 218 ov_map.setMapType(map.getCurrentMapType()); 219 220 192 221 }); 193 222 194 223 } 224 catch(e){ alert( e.message ); } 225 226 GEvent.addListener(marker, "dragstart", function(overlay,latlng) { 227 marker.closeInfoWindow(); 228 }); 229 230 GEvent.addListener(marker, "dragend", function() { 231 var latlng = marker.getPoint(); 232 233 /* var myHtml = "Nouvelle position:"+ "<input type=\"text\" name=\"lat\" value="+latlng.lat()+" /><input type=\"text\" name=\"lon\" value="+latlng.lng()+" /> "; 234 map.openInfoWindow(latlng, myHtml); 235 */ 236 document.Envoie.lat.value=latlng.lat() ; 237 document.Envoie.lon.value=latlng.lng() ; 238 }); 195 239 GEvent.addListener(map,"click", function(overlay,latlng) 196 240 { … … 212 256 213 257 214 } 215 catch(e){ alert( e.message ); } 258 216 259 217 260
Note: See TracChangeset
for help on using the changeset viewer.