new-poly: its finally working

This commit is contained in:
muerwre 2018-12-24 13:44:14 +07:00
parent 34f99771b1
commit aab1ee18b8
2 changed files with 89 additions and 80 deletions

View file

@ -33,6 +33,7 @@ export class NewPoly {
onMarkerDragEnd: this.updateMarks,
onPointAdded: this.updateMarks,
onPointDropped: this.updateMarks,
onContinueDrawing: this.setModeOnDrawing,
onMarkersHide: () => console.log('all markers are hidden'),
onMarkersShow: () => console.log('all markers are visible'),
@ -53,6 +54,9 @@ export class NewPoly {
this.arrows = new L.LayerGroup().addTo(map);
}
setModeOnDrawing = () => {
if (this.editor.getMode() !== MODES.POLY) this.editor.setMode(MODES.POLY);
};
drawArrows = () => {
this.arrows.clearLayers();
@ -80,8 +84,8 @@ export class NewPoly {
});
};
updateMarks = (e) => {
// console.log('upd', e);
updateMarks = (e, callee) => {
console.log('upd', callee);
// return;
const coords = this.poly.toGeoJSON().geometry.coordinates;