mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +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
|
@ -141,7 +141,7 @@ const run = async () => {
|
||||||
title: '',
|
title: '',
|
||||||
version: 1,
|
version: 1,
|
||||||
distance: calcPolyDistance(route),
|
distance: calcPolyDistance(route),
|
||||||
is_public: false,
|
is_public: true,
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
todo tooltips
|
todo tooltips
|
||||||
|
|
||||||
done better poly editor https://github.com/SupriyaSudhindra/leaflet-editable-polyline
|
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
|
done stickers drag on rotate bug
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import L from 'leaflet';
|
import L from 'leaflet';
|
||||||
import 'leaflet-geometryutil';
|
import 'leaflet-geometryutil';
|
||||||
import '../utils/EditablePolyline';
|
import '$utils/EditablePolyline';
|
||||||
import { simplify } from '$utils/simplify';
|
import { simplify } from '$utils/simplify';
|
||||||
import { findDistance, middleCoord } from '$utils/geom';
|
import { findDistance, middleCoord } from '$utils/geom';
|
||||||
import { CLIENT } from '$config/frontend';
|
import { CLIENT } from '$config/frontend';
|
||||||
|
@ -11,19 +11,12 @@ const polyStyle = {
|
||||||
weight: '6',
|
weight: '6',
|
||||||
markerMid: 'url(#arrow)'
|
markerMid: 'url(#arrow)'
|
||||||
};
|
};
|
||||||
// const polyStyle = { color: '#ff3344', weight: '5' };
|
|
||||||
|
|
||||||
export class NewPoly {
|
export class NewPoly {
|
||||||
constructor({
|
constructor({
|
||||||
map, routerMoveStart, lockMapClicks, setTotalDist, triggerOnChange, editor,
|
map, routerMoveStart, lockMapClicks, setTotalDist, triggerOnChange, editor,
|
||||||
}) {
|
}) {
|
||||||
// this.poly = L.polyline([], polyStyle);
|
const coordinates = [];
|
||||||
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 },
|
|
||||||
];
|
|
||||||
|
|
||||||
this.poly = L.Polyline.PolylineEditor(coordinates, {
|
this.poly = L.Polyline.PolylineEditor(coordinates, {
|
||||||
...polyStyle,
|
...polyStyle,
|
||||||
|
|
|
@ -4,7 +4,9 @@ import { CLIENT } from '$config/frontend';
|
||||||
import { DomMarker } from '$utils/DomMarker';
|
import { DomMarker } from '$utils/DomMarker';
|
||||||
|
|
||||||
export class Router {
|
export class Router {
|
||||||
constructor({ map, lockMapClicks, setRouterPoints, pushPolyPoints }) {
|
constructor({
|
||||||
|
map, lockMapClicks, setRouterPoints, pushPolyPoints
|
||||||
|
}) {
|
||||||
this.waypoints = [];
|
this.waypoints = [];
|
||||||
this.lockMapClicks = lockMapClicks;
|
this.lockMapClicks = lockMapClicks;
|
||||||
this.setRouterPoints = setRouterPoints;
|
this.setRouterPoints = setRouterPoints;
|
||||||
|
|
|
@ -267,10 +267,10 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: optimise this
|
// todo: optimise this
|
||||||
for (let polylineNo in that._map._editablePolylines) {
|
for (const polylineNo in that._map._editablePolylines) {
|
||||||
const polyline = that._map._editablePolylines[polylineNo];
|
const polyline = that._map._editablePolylines[polylineNo];
|
||||||
|
|
||||||
for (let markerNo in polyline._markers) {
|
for (const markerNo in polyline._markers) {
|
||||||
const marker = polyline._markers[markerNo];
|
const marker = polyline._markers[markerNo];
|
||||||
|
|
||||||
if (found < that._options.maxMarkers) {
|
if (found < that._options.maxMarkers) {
|
||||||
|
@ -435,6 +435,8 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
||||||
|
|
||||||
this._markers.splice(_pointNo, 1);
|
this._markers.splice(_pointNo, 1);
|
||||||
this._reloadPolyline(_pointNo);
|
this._reloadPolyline(_pointNo);
|
||||||
|
|
||||||
|
if (this._options.onPointAdded) this._options.onPointAdded(event, 'dropped');
|
||||||
});
|
});
|
||||||
|
|
||||||
// marker.on(that._options.addFirstLastPointEvent, (event) => {
|
// marker.on(that._options.addFirstLastPointEvent, (event) => {
|
||||||
|
|
|
@ -30,7 +30,7 @@ export const pushLoaderState = state => {
|
||||||
document.getElementById('loader-bar').style.width = `${state}%`;
|
document.getElementById('loader-bar').style.width = `${state}%`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const pushNetworkInitError = state => {
|
export const pushNetworkInitError = () => {
|
||||||
document.getElementById('loader-error').style.opacity = 1;
|
document.getElementById('loader-error').style.opacity = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue