Convert this from Google Maps API v2 to v3
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开发者_StackOverflow中文版((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;
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.
精彩评论