谷歌地图叠加自定义地图类型(wms\wmts服务)
1、
const wmsMapType = new window.google.maps.ImageMapType({
maxZoom: 22,
minZoom: 0,
name: 'name',
tileSize: new window.google.maps.Size(256, 256),
isPng: true,
getTileUrl: (coord, zoom) => {
return `http://24j826032t.qicp.vip/arcgis/rest/services/MyMapService/MapServer/WMTS?SERVICE=WMTS&REQUEST=GetTile&TILEMATRIX=${zoom}&TILEROW=${coord.x}&TILECOL=${coord.y}`
}
})
map.overlayMapTypes.insertAt(0, wmsMapType)
清除自定义地图类型:
map.overlayMapTypes.removeAt(index)
清除所有overlayMapTypes:
map.overlayMapTypes.clear()