一、maptalks
1、定位
centerTOPoint = ( longitude , latitude ) => {
const coord = new Coordinate(longitude , latitude)
if (this.map.getZoom() >= 15) {
this.map.panTo(coord, {
animation : true,
duration : 1000
})
} else {
this.map.setCenter(coord)
this.map.setZoom(15)
}
}
2 、map事件使用
this.map.on('click', (param) => {
console.log('handle')
})
3、移除指定id的图层
deleteLayer (key) {
console.log('移除id=' + key + '的图层')
const layer = this.map.getLayer(key)
this.map.remove(layer)
}
4、指定id的图层的显隐控制
toggleReaultLayer = (key , checked) => {
const layer = this.map.getLayer(key)
if (checked === false) {
layer.hide()
console.log('隐藏id=' + key + '的图层')
} else {
ayer.show()
console.log('显示id=' + key + '的图层')
}
}
maptalks测量清除方法
clear = () => {
this.distanceTool.endDraw()
this.areaTool.endDraw()
this.distanceTool.clear()
this.areaTool.clear()
}
map事件使用