Changeset 6670 for extensions/rv_gmaps/trunk
- Timestamp:
- Jul 6, 2010, 10:12:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/template/picture_map_content.tpl
r6651 r6670 1 1 {html_head} 2 <script src="http://maps.google.com/maps ?file=api&v=2&key={$GMAPS_API_KEY}&hl={$lang_info.code}" type="text/javascript"></script>2 <script src="http://maps.google.com/maps/api/js?sensor=false&hl={$lang_info.code}" type="text/javascript"></script> 3 3 {* <script src="{$PLUGIN_ROOT_URL}/template/windows_13/javascripts/prototype.js" type="text/javascript"></script> *} 4 4 <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script> … … 41 41 function onLoad() 42 42 { 43 if (!GBrowserIsCompatible()) 44 return; 43 var mapElement = document.getElementById("map"); 44 var mapOpts = { 45 {/literal}{if isset($coordinates)} 46 center: new google.maps.LatLng( {$coordinates.LAT}, {$coordinates.LON} ), 47 zoom : 12, 48 {else} 49 center: new google.maps.LatLng(0,0), 50 zoom : 1, 51 {/if}{literal} 52 mapTypeId: google.maps.MapTypeId.ROADMAP 53 }; 54 55 var map = new google.maps.Map( mapElement, mapOpts ); 45 56 46 var mapElement = document.getElementById("map"); 47 var map = new GMap2( mapElement ); 48 49 map.addControl(new GLargeMapControl()); 50 map.addControl(new GMapTypeControl()); 51 map.addControl(new GScaleControl()); 52 {/literal}{if isset($coordinates)} 53 var coord = new google.maps.LatLng( {$coordinates.LAT}, {$coordinates.LON} ); 54 map.setCenter( coord, 12 ); 55 var marker = new google.maps.Marker(coord); 56 map.addOverlay(marker); 57 {/if}{literal} 58 if ( !map.isLoaded() ) 59 map.setCenter( new google.maps.LatLng(0,0), 2); 60 try { 61 // the overview must be added after setting map center 62 var ovcontrol = new GOverviewMapControl(new GSize(165,165)); 63 map.addControl(ovcontrol); 64 var ov_map = ovcontrol.getOverviewMap(); 65 google.maps.Event.addListener(map, 'maptypechanged', function(){ 66 ov_map.setMapType(G_NORMAL_MAP); 57 {/literal}{if isset($coordinates)} 58 var marker = new google.maps.Marker( {ldelim} 59 position: map.getCenter(), 60 map: map 67 61 }); 68 } 69 catch(e){ alert( e.message ); } 70 71 map.enableDoubleClickZoom(); 62 {/if}{literal} 72 63 } 73 64 … … 96 87 97 88 Event.observe(window, 'load', onLoad ); 98 Event.observe(window, 'unload', GUnload );99 89 //]]> 100 90 {/literal}</script>
Note: See TracChangeset
for help on using the changeset viewer.