Answer the question
In order to leave comments, you need to log in
Clear object from events?
Good afternoon, I'm drawing polygons, I put the polygon removal event on the delete button:
doDeletePolygon() {
const t = this;
this.mapObject.geoObjects.events.add(
"click",
function(e) {
if (e.get("target").getParent() == this) {
this.remove(e.get("target"));
t.currentZone.polygons = t.currentZone.polygons.filter(
zone => zone.id !== e.get("target").options.get("id")
);
t.$store.commit("changeCurrentZone", t.currentZone);
}
},
this.mapObject.geoObjects
);
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question