Ignore:
Timestamp:
Jul 6, 2010, 10:12:14 PM (14 years ago)
Author:
rvelices
Message:

rv_gmaps picture page uses google maps api v3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/template/picture_map_content.tpl

    r6651 r6670  
    11{html_head}
    2 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={$GMAPS_API_KEY}&amp;hl={$lang_info.code}" type="text/javascript"></script>
     2<script src="http://maps.google.com/maps/api/js?sensor=false&amp;hl={$lang_info.code}" type="text/javascript"></script>
    33{* <script src="{$PLUGIN_ROOT_URL}/template/windows_13/javascripts/prototype.js" type="text/javascript"></script> *}
    44<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
     
    4141function onLoad()
    4242{
    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 );
    4556
    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
    6761                });
    68   }
    69         catch(e){ alert( e.message ); }
    70 
    71         map.enableDoubleClickZoom();
     62{/if}{literal}
    7263}
    7364
     
    9687
    9788Event.observe(window, 'load', onLoad );
    98 Event.observe(window, 'unload', GUnload );
    9989//]]>
    10090{/literal}</script>
Note: See TracChangeset for help on using the changeset viewer.