mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
new-poly: removed leaflet-editable
This commit is contained in:
parent
630ed43525
commit
34f99771b1
8 changed files with 15 additions and 15 deletions
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ export class NewPoly {
|
|||
];
|
||||
|
||||
this.poly.setLatLngs(summary);
|
||||
this.poly.enableEdit();
|
||||
this.poly.editor.enable();
|
||||
this.poly.editor.reset();
|
||||
this.updateMarks();
|
||||
};
|
||||
|
|
|
@ -165,7 +165,7 @@ export class Poly {
|
|||
|
||||
clearAll = () => {
|
||||
this.poly.setLatLngs([]);
|
||||
this.poly.disableEdit();
|
||||
// this.poly.disableEdit();
|
||||
|
||||
this.updateMarks();
|
||||
};
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -35,7 +35,7 @@ export class Stickers {
|
|||
this.stickers.push(marker);
|
||||
|
||||
marker.marker.addTo(this.map);
|
||||
marker.marker.enableEdit();
|
||||
// marker.marker.enableEdit();
|
||||
};
|
||||
|
||||
deleteStickerByReference = ref => {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue