From 2e26fecf3438b212f549e9ada30d75dfc22af8fe Mon Sep 17 00:00:00 2001 From: muerwre Date: Fri, 22 Feb 2019 08:49:23 +0700 Subject: [PATCH] (added editor events) --- src/modules/InteractivePoly.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/InteractivePoly.ts b/src/modules/InteractivePoly.ts index 33c0fb1..2f201ff 100644 --- a/src/modules/InteractivePoly.ts +++ b/src/modules/InteractivePoly.ts @@ -104,16 +104,16 @@ export class InteractivePoly extends Polyline { disable: () => { this.hideAllMarkers(); this.is_editing = false; + this.fire('editordisable'); }, enable: () => { this.is_editing = true; this.showVisibleMarkers(); + this.fire('editorenable'); } }; onMarkerDrag = ({ target }: { target: Marker}) => { - console.log(this.vertex_index, this.markers.length); - this.setConstraints( this.vertex_index > 0 && this.markers[this.vertex_index - 1].getLatLng(), target.getLatLng(), @@ -211,4 +211,7 @@ InteractivePoly.addInitHook(function () { allvertexhide allvertexshow + + editordisable + editorenable */