From 34f99771b1d6d6ccd88351921f5482adb1cfad5e Mon Sep 17 00:00:00 2001 From: muerwre Date: Thu, 20 Dec 2018 18:51:10 +0700 Subject: [PATCH] new-poly: removed leaflet-editable --- src/modules/Editor.js | 6 +++--- src/modules/Map.js | 2 +- src/modules/NewPoly.js | 2 +- src/modules/Poly.js | 2 +- src/modules/Sticker.js | 8 ++++---- src/modules/Stickers.js | 2 +- src/parts/map.js | 6 +++--- src/parts/poly.js | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/modules/Editor.js b/src/modules/Editor.js index 67b67cf..146ec80 100644 --- a/src/modules/Editor.js +++ b/src/modules/Editor.js @@ -1,6 +1,6 @@ import { Map } from '$modules/Map'; import { NewPoly } from '$modules/NewPoly'; -import { Poly } from '$modules/Poly'; +// import { Poly } from '$modules/Poly'; import { MODES } from '$constants/modes'; import { Stickers } from '$modules/Stickers'; import { Router } from '$modules/Router'; @@ -287,12 +287,12 @@ export class Editor { this.setInitialData(); this.owner = { id }; - if (this.poly.latlngs && this.poly.latlngs.length > 1) this.poly.poly.enableEdit(); + if (this.poly.latlngs && this.poly.latlngs.length > 1) this.poly.poly.editor.enable(); this.stickers.startEditing(); }; stopEditing = () => { - this.poly.poly.disableEdit(); + this.poly.poly.editor.disable(); this.stickers.stopEditing(); }; diff --git a/src/modules/Map.js b/src/modules/Map.js index bee5d4d..c2e850f 100644 --- a/src/modules/Map.js +++ b/src/modules/Map.js @@ -1,6 +1,6 @@ import { map, tileLayer } from 'leaflet'; import 'leaflet/dist/leaflet.css'; -import 'leaflet-editable'; +// import 'leaflet-editable'; import { PROVIDER } from '$config/frontend'; import { DEFAULT_PROVIDER, PROVIDERS } from '$constants/providers'; diff --git a/src/modules/NewPoly.js b/src/modules/NewPoly.js index 4d1a58a..a0f9645 100644 --- a/src/modules/NewPoly.js +++ b/src/modules/NewPoly.js @@ -183,7 +183,7 @@ export class NewPoly { ]; this.poly.setLatLngs(summary); - this.poly.enableEdit(); + this.poly.editor.enable(); this.poly.editor.reset(); this.updateMarks(); }; diff --git a/src/modules/Poly.js b/src/modules/Poly.js index 2dbe540..bb8fe66 100644 --- a/src/modules/Poly.js +++ b/src/modules/Poly.js @@ -165,7 +165,7 @@ export class Poly { clearAll = () => { this.poly.setLatLngs([]); - this.poly.disableEdit(); + // this.poly.disableEdit(); this.updateMarks(); }; diff --git a/src/modules/Sticker.js b/src/modules/Sticker.js index 1931a6a..3c561c1 100644 --- a/src/modules/Sticker.js +++ b/src/modules/Sticker.js @@ -1,5 +1,5 @@ import { marker } from 'leaflet'; -import 'leaflet-editable'; +// import 'leaflet-editable'; import React from 'react'; import { DomMarker } from '$utils/DomMarker'; @@ -60,7 +60,7 @@ export class Sticker { className: 'sticker-container', }); - this.marker = marker(latlng, { icon: mark }); + this.marker = marker(latlng, { icon: mark, draggable: true }); this.element.addEventListener('mouseup', this.onDragStop); this.element.addEventListener('mouseup', this.preventPropagations); @@ -89,7 +89,7 @@ export class Sticker { window.addEventListener('mousemove', this.onDrag); window.addEventListener('mouseup', this.onDragStop); - this.marker.disableEdit(); + // this.marker.disableEdit(); }; preventPropagations = e => { @@ -110,7 +110,7 @@ export class Sticker { this.lockMapClicks(false); - this.marker.enableEdit(); + // this.marker.enableEdit(); }; onDrag = e => { diff --git a/src/modules/Stickers.js b/src/modules/Stickers.js index aa94c64..39e394d 100644 --- a/src/modules/Stickers.js +++ b/src/modules/Stickers.js @@ -35,7 +35,7 @@ export class Stickers { this.stickers.push(marker); marker.marker.addTo(this.map); - marker.marker.enableEdit(); + // marker.marker.enableEdit(); }; deleteStickerByReference = ref => { diff --git a/src/parts/map.js b/src/parts/map.js index 93fbc0d..d4a6d58 100644 --- a/src/parts/map.js +++ b/src/parts/map.js @@ -1,8 +1,8 @@ import L from 'leaflet'; -import 'leaflet-editable'; -import 'leaflet.markercluster'; -import 'leaflet.markercluster.webpack'; +// import 'leaflet-editable'; +// import 'leaflet.markercluster'; +// import 'leaflet.markercluster.webpack'; import 'leaflet-geometryutil'; import { mapStyles } from '$constants/mapStyles'; diff --git a/src/parts/poly.js b/src/parts/poly.js index beac0c0..98a6043 100644 --- a/src/parts/poly.js +++ b/src/parts/poly.js @@ -133,7 +133,7 @@ const insertVertex = ({ e, updatePolyCoords }) => { } // если точка найдена, добавляем её в отрезок if (pos.length>1) { - poly.editor.disable(); + // poly.editor.disable(); latlngs.splice(pos[1],0,e.latlng); poly.setLatLngs(latlngs); poly.editor.initVertexMarkers();