参考文档 https://lbs.amap.com/api/webservice/guide/api/staticmaps/
需求是, 通过经纬度坐标, 返回一个地图的标注图, 最后展示的是一个图片.

openGisDialog (record) {
this.gisImgVisible = true;
let gisImg = {
mainKey: gisUrl ,
key: 你的key , //
location:`${record.longitude},${record.latitude}`,
zoom: 15 ,
size: 600*400 ,
scale: 2 ,
markers:`-1,${record.modelImg},:${record.longitude},${record.latitude}`,
gisUrl: http://restapi.amap.com/v3/staticmap? ,
}
this.gisTitle = `${record.waterMode}[${record.waterSection}]`
this.gisImgUrl = this.getGisImgUrl(gisImg)
},
getGisImgUrl (obj) {
let url =
let params = []
for (let key in obj) {
if (key === obj.mainKey) {
url = obj[key]
} else if (key !== mainKey ) {
params.push(`${key}=${obj[key]}`)
}
}
url += params.join( & )
return url
},
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...



