(added editor events)

This commit is contained in:
muerwre 2019-02-22 08:49:23 +07:00
parent 99071ee639
commit 2e26fecf34

View file

@ -104,16 +104,16 @@ export class InteractivePoly extends Polyline {
disable: () => { disable: () => {
this.hideAllMarkers(); this.hideAllMarkers();
this.is_editing = false; this.is_editing = false;
this.fire('editordisable');
}, },
enable: () => { enable: () => {
this.is_editing = true; this.is_editing = true;
this.showVisibleMarkers(); this.showVisibleMarkers();
this.fire('editorenable');
} }
}; };
onMarkerDrag = ({ target }: { target: Marker}) => { onMarkerDrag = ({ target }: { target: Marker}) => {
console.log(this.vertex_index, this.markers.length);
this.setConstraints( this.setConstraints(
this.vertex_index > 0 && this.markers[this.vertex_index - 1].getLatLng(), this.vertex_index > 0 && this.markers[this.vertex_index - 1].getLatLng(),
target.getLatLng(), target.getLatLng(),
@ -211,4 +211,7 @@ InteractivePoly.addInitHook(function () {
allvertexhide allvertexhide
allvertexshow allvertexshow
editordisable
editorenable
*/ */