Replacing GTileLayer in Google Maps v3, with ImageMapType, Tile bounding box?

后端 未结 3 1328
陌清茗
陌清茗 2021-02-03 15:21

I need to update this code:

radar_layer.getTileUrl=function(tile,zoom) {

    var llp = new GPoint(tile.x*256,(tile.y+1)*256);
    var urp = new         


        
3条回答
  •  别那么骄傲
    2021-02-03 16:07

    It's worked for me

    I used MapBox.Light Style Tileset on the top of Google API V3

    function loadMap() {
        // Default the map view to the continental U.S.
        mapOptions = {
          center: new google.maps.LatLng(17.387140, 78.491684),
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          zoom: 8
        };
    
        map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
    
        var imageMapType = new google.maps.ImageMapType({
          getTileUrl: function(coord, zoom) {
            return "https://api.mapbox.com/v4/mapbox.light/" +zoom+"/"+coord.x+"/"+coord.y+"@2x.png?access_token=<>";
    
          },
          tileSize: new google.maps.Size(256, 256)
        });
    
        map.overlayMapTypes.push(imageMapType);        
    
    }
    
    loadMap();
    

提交回复
热议问题