我加入 “画互动” 和绘图功能在地图上...的OpenLayers 3移除绘制的地图
webMapValues.drawObj = new ol.interaction.Draw({
features: features,
type: /** @type {ol.geom.GeometryType} */ (webMapValues.drawType)
});
我捕捉 “drawend” 事件...
webMapValues.drawObj.on('drawend', function (e) {
//Here I am saving my feature to a data base
and displaying the saved vector...
control.UpdateObjects(e, "Draw");
//Here I would like to remove the vector that
draw interaction placed and just display the
vector from the db
});
我不知道如何删除ol.interaction.Draw放置的矢量,以便在我保存后只显示数据库中的矢量?
我猜“drawend”是不是做这个的地方......但我不知道如何实现我需要那么功能...
任何帮助是极大的赞赏!
那么我该如何达到理想的行为呢?我可以以某种方式调用finishDrawing并停止绘制草图功能? –