Changeset 6609


Ignore:
Timestamp:
Jun 26, 2010, 9:13:30 PM (14 years ago)
Author:
rvelices
Message:

rv_gmaps - start using google.maps JS namespace

Location:
extensions/rv_gmaps/trunk/template
Files:
8 edited

Legend:

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

    r6245 r6609  
    4545
    4646        var mapElement = document.getElementById("map");
    47         map = new GMap2( mapElement );
     47        map = new google.maps.Map2( mapElement );
    4848
    4949        map.addMapType( G_PHYSICAL_MAP );
    50         map.addControl(new GLargeMapControl3D());
    51         map.addControl(new GHierarchicalMapTypeControl());
    52         map.addControl(new GScaleControl());
     50        map.addControl(new google.maps.LargeMapControl3D());
     51        map.addControl(new google.maps.HierarchicalMapTypeControl());
     52        map.addControl(new google.maps.ScaleControl());
    5353
    5454        pwgPageLinker = new PageLinker(map, "aLinkToThisPage" );
     
    5757{/literal}
    5858                {if isset($initial_bounds)}
    59                 var bounds = new GLatLngBounds( new GLatLng({$initial_bounds.s},{$initial_bounds.w}), new GLatLng({$initial_bounds.n},{$initial_bounds.e}) );
     59                var bounds = new google.maps.LatLngBounds( new google.maps.LatLng({$initial_bounds.s},{$initial_bounds.w}), new google.maps.LatLng({$initial_bounds.n},{$initial_bounds.e}) );
    6060                map.setCenter( bounds.getCenter(), map.getBoundsZoomLevel( bounds ) );
    6161                {/if}
    6262{literal}
    6363                if ( !map.isLoaded() )
    64                         map.setCenter( new GLatLng(0,0), 2 );
     64                        map.setCenter( new google.maps.LatLng(0,0), 2 );
    6565        }
    6666
    6767        try {
    6868                // the overview must be added after setting map center
    69                 var ovcontrol = new GOverviewMapControl(new GSize(165,165));
     69                var ovcontrol = new google.maps.OverviewMapControl(new google.maps.Size(165,165));
    7070                map.addControl(ovcontrol);
    7171        }
     
    7878
    7979        map.pwgDataLoader = new PwgDataLoader(map, {rectangle_of_confusion: pwgMarkerIcon.iconSize} );
    80         GEvent.addListener(map.pwgDataLoader, "dataloading", function() {
     80        google.maps.Event.addListener(map.pwgDataLoader, "dataloading", function() {
    8181                var pre = '<img src="{/literal}{$PLUGIN_ROOT_URL}{literal}/icons/progress_s.gif" width="16" height="16" alt="~" /> ';
    8282                document.getElementById("dataLoadStatus").innerHTML = pre + Localization.get("Loading");
     
    8484        );
    8585 
    86         GEvent.addListener(map.pwgDataLoader, "dataloadfailed", function(responseCode) {
     86        google.maps.Event.addListener(map.pwgDataLoader, "dataloadfailed", function(responseCode) {
    8787                document.getElementById("dataLoadStatus").innerHTML = Localization.get("Failed") + " "+responseCode;
    8888                }
     
    9090
    9191        map.pwgDataHandler = new PwgDataHandler(map, {icon: pwgMarkerIcon, show_all_img_src: "{/literal}{$PLUGIN_ROOT_URL}{literal}/icons/pic_s.gif" } );
    92         GEvent.addListener(map.pwgDataLoader, "dataloaded", map.pwgDataHandler.handle.bind(map.pwgDataHandler) );
     92        google.maps.Event.addListener(map.pwgDataLoader, "dataloaded", map.pwgDataHandler.handle.bind(map.pwgDataHandler) );
    9393
    9494        map.pwgDataLoader.start( "{/literal}{$U_MAP_DATA}{literal}" );
     
    9696        if (document.is_debug)
    9797        {
    98                 GEvent.addListener(map, "moveend", function() { GLog.write("movend c:"+map.getCenter().toUrlValue());} );
    99                 GEvent.addListener(map, "maptypechanged", function() { GLog.write("maptypechanged");} );
    100                 GEvent.addListener(map, "infowindowopen", function() { GLog.write("infowindowopen");} );
    101                 GEvent.addListener(map, "infowindowclose", function() { GLog.write("infowindowclose");} );
     98                google.maps.Event.addListener(map, "moveend", function() { google.maps.Log.write("movend c:"+map.getCenter().toUrlValue());} );
     99                google.maps.Event.addListener(map, "maptypechanged", function() { google.maps.Log.write("maptypechanged");} );
     100                google.maps.Event.addListener(map, "infowindowopen", function() { google.maps.Log.write("infowindowopen");} );
     101                google.maps.Event.addListener(map, "infowindowclose", function() { google.maps.Log.write("infowindowclose");} );
    102102        }
    103103}
     
    117117        if (!q.length) return false;
    118118        if (!geocoder)
    119                 geocoder = new GClientGeocoder();
     119                geocoder = new google.maps.ClientGeocoder();
    120120        geocoder.getLocations(q, function(resp)
    121121          {
     
    136136                          case 7: case 8: zoom=16; break; //intersection/exact
    137137                        }
    138                         map.setCenter( new GLatLng( resp.Placemark[0].Point.coordinates[1], resp.Placemark[0].Point.coordinates[0] ), zoom);
     138                        map.setCenter( new google.maps.LatLng( resp.Placemark[0].Point.coordinates[1], resp.Placemark[0].Point.coordinates[0] ), zoom);
    139139                  }
    140140                  else
     
    169169                if (lang_str == undefined)
    170170                {
    171                         if (document.is_debug) GLog.write("Language string undefined '"+ str+"'");
     171                        if (document.is_debug) google.maps.Log.write("Language string undefined '"+ str+"'");
    172172                        return str;
    173173                }
  • extensions/rv_gmaps/trunk/template/markers/small_bullet_orange.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "{$PLUGIN_ROOT_URL}/template/markers/small_bullet_orange.png";
    3 icon.iconSize = new GSize(11, 11);
    4 icon.iconAnchor = new GPoint(5, 5);
    5 icon.infoWindowAnchor = new GPoint(5, 0);
     3icon.iconSize = new google.maps.Size(11, 11);
     4icon.iconAnchor = new google.maps.Point(5, 5);
     5icon.infoWindowAnchor = new google.maps.Point(5, 0);
    66return icon;
  • extensions/rv_gmaps/trunk/template/markers/small_bullet_red.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "{$PLUGIN_ROOT_URL}/template/markers/small_bullet_red.png";
    3 icon.iconSize = new GSize(11, 11);
    4 icon.iconAnchor = new GPoint(5, 5);
    5 icon.infoWindowAnchor = new GPoint(5, 0);
     3icon.iconSize = new google.maps.Size(11, 11);
     4icon.iconAnchor = new google.maps.Point(5, 5);
     5icon.infoWindowAnchor = new google.maps.Point(5, 0);
    66return icon;
  • extensions/rv_gmaps/trunk/template/markers/small_bullet_yellow.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "{$PLUGIN_ROOT_URL}/template/markers/small_bullet_yellow.png";
    3 icon.iconSize = new GSize(11, 11);
    4 icon.iconAnchor = new GPoint(5, 5);
    5 icon.infoWindowAnchor = new GPoint(5, 0);
     3icon.iconSize = new google.maps.Size(11, 11);
     4icon.iconAnchor = new google.maps.Point(5, 5);
     5icon.infoWindowAnchor = new google.maps.Point(5, 0);
    66return icon;
  • extensions/rv_gmaps/trunk/template/markers/small_dot_blue.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
    33icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    4 icon.iconSize = new GSize(12, 20);
    5 icon.shadowSize = new GSize(22, 20);
    6 icon.iconAnchor = new GPoint(6, 20);
    7 icon.infoWindowAnchor = new GPoint(5, 1);
     4icon.iconSize = new google.maps.Size(12, 20);
     5icon.shadowSize = new google.maps.Size(22, 20);
     6icon.iconAnchor = new google.maps.Point(6, 20);
     7icon.infoWindowAnchor = new google.maps.Point(5, 1);
    88return icon;
  • extensions/rv_gmaps/trunk/template/markers/small_dot_green.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "http://labs.google.com/ridefinder/images/mm_20_green.png";
    33icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    4 icon.iconSize = new GSize(12, 20);
    5 icon.shadowSize = new GSize(22, 20);
    6 icon.iconAnchor = new GPoint(6, 20);
    7 icon.infoWindowAnchor = new GPoint(5, 1);
     4icon.iconSize = new google.maps.Size(12, 20);
     5icon.shadowSize = new google.maps.Size(22, 20);
     6icon.iconAnchor = new google.maps.Point(6, 20);
     7icon.infoWindowAnchor = new google.maps.Point(5, 1);
    88return icon;
  • extensions/rv_gmaps/trunk/template/markers/small_dot_purple.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "http://labs.google.com/ridefinder/images/mm_20_purple.png";
    33icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    4 icon.iconSize = new GSize(12, 20);
    5 icon.shadowSize = new GSize(22, 20);
    6 icon.iconAnchor = new GPoint(6, 20);
    7 icon.infoWindowAnchor = new GPoint(5, 1);
     4icon.iconSize = new google.maps.Size(12, 20);
     5icon.shadowSize = new google.maps.Size(22, 20);
     6icon.iconAnchor = new google.maps.Point(6, 20);
     7icon.infoWindowAnchor = new google.maps.Point(5, 1);
    88return icon;
  • extensions/rv_gmaps/trunk/template/markers/small_dot_red.tpl

    r3447 r6609  
    1 var icon = new GIcon();
     1var icon = new google.maps.Icon();
    22icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
    33icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    4 icon.iconSize = new GSize(12, 20);
    5 icon.shadowSize = new GSize(22, 20);
    6 icon.iconAnchor = new GPoint(6, 20);
    7 icon.infoWindowAnchor = new GPoint(5, 1);
     4icon.iconSize = new google.maps.Size(12, 20);
     5icon.shadowSize = new google.maps.Size(22, 20);
     6icon.iconAnchor = new google.maps.Point(6, 20);
     7icon.infoWindowAnchor = new google.maps.Point(5, 1);
    88return icon;
Note: See TracChangeset for help on using the changeset viewer.