高德地图 使用 天地图底图

 
效果如下

 附上代码:

 
const KEY = '天地图的KEY'
const xyzTileLayer = new AMap.TileLayer({
// 天地图底图图块取图地址
getTileUrl: `http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=vec_w&tk=${KEY}&x=[x]&y=[y]&l=[z]`,
zIndex: 1
})
const wordTileLayer = new AMap.TileLayer({
// 天地图文字标注图块取图地址
getTileUrl: `http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=cva_w&tk=${KEY}&x=[x]&y=[y]&l=[z]`,
zIndex: 2
})
this.map = new AMap.Map("container", {
resizeEnable: true,
zoom: 15,
 
center: arriveCoor,
layers: [
xyzTileLayer,
wordTileLayer
],
zooms:[3,19],
});

猜你喜欢

转载自www.cnblogs.com/yyf66/p/13186466.html
今日推荐