mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
done update after point delete
This commit is contained in:
parent
121ec610e0
commit
d0b5f3bd94
6 changed files with 13 additions and 15 deletions
|
@ -28,7 +28,8 @@
|
|||
todo tooltips
|
||||
|
||||
done better poly editor https://github.com/SupriyaSudhindra/leaflet-editable-polyline
|
||||
todo update after point delete
|
||||
done update after point delete
|
||||
todo hidden markers tooltip
|
||||
|
||||
done stickers drag on rotate bug
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import L from 'leaflet';
|
||||
import 'leaflet-geometryutil';
|
||||
import '../utils/EditablePolyline';
|
||||
import '$utils/EditablePolyline';
|
||||
import { simplify } from '$utils/simplify';
|
||||
import { findDistance, middleCoord } from '$utils/geom';
|
||||
import { CLIENT } from '$config/frontend';
|
||||
|
@ -11,19 +11,12 @@ const polyStyle = {
|
|||
weight: '6',
|
||||
markerMid: 'url(#arrow)'
|
||||
};
|
||||
// const polyStyle = { color: '#ff3344', weight: '5' };
|
||||
|
||||
export class NewPoly {
|
||||
constructor({
|
||||
map, routerMoveStart, lockMapClicks, setTotalDist, triggerOnChange, editor,
|
||||
}) {
|
||||
// this.poly = L.polyline([], polyStyle);
|
||||
const coordinates = [
|
||||
// { lat: 54.9859, lng: 82.92154 },
|
||||
// { lat: 55.0384, lng: 82.97699 },
|
||||
// { lat: 55.0345, lng: 82.67699 },
|
||||
// { lat: 55.0145, lng: 82.67699 },
|
||||
];
|
||||
const coordinates = [];
|
||||
|
||||
this.poly = L.Polyline.PolylineEditor(coordinates, {
|
||||
...polyStyle,
|
||||
|
|
|
@ -4,7 +4,9 @@ import { CLIENT } from '$config/frontend';
|
|||
import { DomMarker } from '$utils/DomMarker';
|
||||
|
||||
export class Router {
|
||||
constructor({ map, lockMapClicks, setRouterPoints, pushPolyPoints }) {
|
||||
constructor({
|
||||
map, lockMapClicks, setRouterPoints, pushPolyPoints
|
||||
}) {
|
||||
this.waypoints = [];
|
||||
this.lockMapClicks = lockMapClicks;
|
||||
this.setRouterPoints = setRouterPoints;
|
||||
|
|
|
@ -267,10 +267,10 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
|||
}
|
||||
|
||||
// todo: optimise this
|
||||
for (let polylineNo in that._map._editablePolylines) {
|
||||
for (const polylineNo in that._map._editablePolylines) {
|
||||
const polyline = that._map._editablePolylines[polylineNo];
|
||||
|
||||
for (let markerNo in polyline._markers) {
|
||||
for (const markerNo in polyline._markers) {
|
||||
const marker = polyline._markers[markerNo];
|
||||
|
||||
if (found < that._options.maxMarkers) {
|
||||
|
@ -435,6 +435,8 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
|||
|
||||
this._markers.splice(_pointNo, 1);
|
||||
this._reloadPolyline(_pointNo);
|
||||
|
||||
if (this._options.onPointAdded) this._options.onPointAdded(event, 'dropped');
|
||||
});
|
||||
|
||||
// marker.on(that._options.addFirstLastPointEvent, (event) => {
|
||||
|
|
|
@ -30,7 +30,7 @@ export const pushLoaderState = state => {
|
|||
document.getElementById('loader-bar').style.width = `${state}%`;
|
||||
};
|
||||
|
||||
export const pushNetworkInitError = state => {
|
||||
export const pushNetworkInitError = () => {
|
||||
document.getElementById('loader-error').style.opacity = 1;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue