4

This works on Google Maps API v2, now how do I convert this to API v3? Thanks

// - Radar 1 Overlay Tiles
var radar_layer= new GTileLayer(new GCopyrightCollection(""),1,17);
radar_layer.getTileUrl=function(tile,zoom) {
        var llp = new GPoint(tile.x*256,(tile.y+1)*256);
        var urp = new GPoint((tile.x+1)*256,tile.y*256);
        var ll = G_NORMAL_MAP.getProjection().fromPixelToLatLng(llp,zoom);
        var ur = G_NORMAL_MAP.getProjection().fromPixelToLatLng(urp,zoom);
        var dt = new Date();
        var nowtime = dt.getTime();
        var tileurl = "http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?&request=GetMap&service=WMS&version=1.1.1&LAYERS=nexrad-n0r&styles=";
        tileurl+="&format=image/png&bgcolor=0x333333&transparent=true&srs=EPSG:4326&bbox="+ll.x+","+ll.y+","+ur.x+","+ur.y;
        tileurl+="&width=256&height=256&reaspect=false&cachetime="+nowtime;

    return tileurl;
};
radar_layer.getOpacity = function() {return 0.6;}
radar_layer.isPng = function() {return true;}
radaroverlay = new GTileLayerOverlay(radar_layer);
map.addOverlay( radaroverlay );
radarShown = true;
Ossi
  • 788
  • 2
  • 14
  • 21

1 Answers1

4

Perhaps you can start with this: Tips for Upgrading Gmaps v2 to v3 more quickly

Then, if that doesn't get you where you need to go, edit your question to post what you have at that point and someone can try to fix it.

Community
  • 1
  • 1
Trott
  • 66,479
  • 23
  • 173
  • 212