mounted () {
layer = new GraphicsLayer({
id: this.layerId
})
this.drawPoint(this.attributeTemp.longitude, this.attributeTemp.latitude)
}
}
drawPoint (x, y) {
const point = {
type: 'point',
longitude: x,
latitude: y
}
const markerSymbol = {
type: 'simple-marker',
color: [226, 119, 40]
}
pointGraphic = new Graphic({
geometry: point,
symbol: markerSymbol
})
layer.add(pointGraphic)
this.mapTemp.add(layer)
}
beforeDestroy () {
if (layer) {
layer.removeAll()
this.mapTemp.remove(layer)
layer = null
}
}
通过这种方式无法删除绘制点 , 唯一的删除方式是 , view.graphics.add(graphic) , 然后通过view.graphics.removeAll() , 这是个啥子原因
1 个回复
yhl1015951447 - 111111111111111111
赞同来自:
要回复问题请先登录或注册