Changeset 5018 for extensions/rv_gmaps/trunk/template/map.tpl
- Timestamp:
- Mar 1, 2010, 10:29:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/template/map.tpl
r4070 r5018 35 35 document.is_debug = false; 36 36 if ( document.location.search.match(/[\?&]debug/) ) { 37 38 37 document.is_debug = true; 38 document._window = window; 39 39 } 40 40 … … 48 48 49 49 map.addMapType( G_PHYSICAL_MAP ); 50 map.addControl(new GLargeMapControl ());50 map.addControl(new GLargeMapControl3D()); 51 51 map.addControl(new GHierarchicalMapTypeControl()); 52 52 map.addControl(new GScaleControl()); … … 57 57 {/literal} 58 58 {if isset($initial_bounds)} 59 60 59 var bounds = new GLatLngBounds( new GLatLng({$initial_bounds.s},{$initial_bounds.w}), new GLatLng({$initial_bounds.n},{$initial_bounds.e}) ); 60 map.setCenter( bounds.getCenter(), map.getBoundsZoomLevel( bounds ) ); 61 61 {/if} 62 62 {literal} 63 63 if ( !map.isLoaded() ) 64 64 map.setCenter( new GLatLng(0,0), 2 ); 65 66 67 65 } 66 67 try { 68 68 // the overview must be added after setting map center 69 69 var ovcontrol = new GOverviewMapControl(new GSize(165,165)); 70 70 map.addControl(ovcontrol); 71 72 73 71 } 72 catch(e){ alert( e.message ); } 73 74 74 map.enableScrollWheelZoom(); 75 75 map.enableDoubleClickZoom(); 76 76 77 77 var pwgMarkerIcon = (function(){ {/literal}{$MAP_MARKER_ICON_JS}{literal} }).call(null); 78 78 … … 100 100 GEvent.addListener(map, "infowindowopen", function() { GLog.write("infowindowopen");} ); 101 101 GEvent.addListener(map, "infowindowclose", function() { GLog.write("infowindowclose");} ); 102 102 } 103 103 } 104 104 … … 120 120 geocoder.getLocations(q, function(resp) 121 121 { 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 122 if ( resp && resp.Status ) 123 { 124 document._geoResponse = resp; 125 if (resp.Status.code==200) 126 { 127 var zoom = 2; 128 switch (resp.Placemark[0].AddressDetails.Accuracy) 129 { 130 case 1: zoom=5; break; //country 131 case 2: zoom=7; break; //region 132 case 3: zoom=8; break; //county 133 case 4: zoom=12; break; //town 134 case 5: zoom=13; break; //post code 135 case 6: zoom=14; break; //street 136 case 7: case 8: zoom=16; break; //intersection/exact 137 } 138 map.setCenter( new GLatLng( resp.Placemark[0].Point.coordinates[1], resp.Placemark[0].Point.coordinates[0] ), zoom); 139 } 140 else 141 alert("This address has not been found\nCode:"+resp.Status.code); 142 } 143 143 }); 144 144 return false;
Note: See TracChangeset
for help on using the changeset viewer.