mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
fixed middle markers stay on marker deletion
This commit is contained in:
parent
8a90c50352
commit
bb661b976b
5 changed files with 11 additions and 10 deletions
|
@ -175,4 +175,4 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
setDialogActive,
|
setDialogActive,
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export const MapListMoreDialog = connect(mapStateToProps, mapDispatchToProps)(Component);
|
export const MapListDialog = connect(mapStateToProps, mapDispatchToProps)(Component);
|
|
@ -4,7 +4,7 @@ import { DIALOGS } from '$constants/dialogs';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { AppInfoDialog } from '$components/dialogs/AppInfoDialog';
|
import { AppInfoDialog } from '$components/dialogs/AppInfoDialog';
|
||||||
import { Icon } from '$components/panels/Icon';
|
import { Icon } from '$components/panels/Icon';
|
||||||
import { MapListMoreDialog } from '$components/dialogs/MapListMoreDialog';
|
import { MapListDialog } from '$components/dialogs/MapListDialog';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
dialog: String,
|
dialog: String,
|
||||||
|
@ -14,7 +14,7 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const LEFT_DIALOGS = {
|
const LEFT_DIALOGS = {
|
||||||
[DIALOGS.MAP_LIST]: MapListMoreDialog,
|
[DIALOGS.MAP_LIST]: MapListDialog,
|
||||||
[DIALOGS.APP_INFO]: AppInfoDialog,
|
[DIALOGS.APP_INFO]: AppInfoDialog,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
## BUGS
|
## BUGS
|
||||||
|
|
||||||
todo cancelling editing someone's else map return back to it's original address /razminochnyj/
|
todo adding/removing points doesn't change distance
|
||||||
|
done cancelling editing someone's else map return back to it's original address /razminochnyj/
|
||||||
todo selecting logo on crop
|
todo selecting logo on crop
|
||||||
todo delete sticker icon
|
todo delete sticker icon
|
||||||
todo fix arrows (can't reproduce now :-( )
|
todo fix arrows (can't reproduce now :-( )
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { map, tileLayer } from 'leaflet';
|
import { map, tileLayer } from 'leaflet';
|
||||||
import 'leaflet/dist/leaflet.css';
|
import 'leaflet/dist/leaflet.css';
|
||||||
// import 'leaflet-editable';
|
|
||||||
import { PROVIDER } from '$config/frontend';
|
import { PROVIDER } from '$config/frontend';
|
||||||
import { DEFAULT_PROVIDER, PROVIDERS } from '$constants/providers';
|
import { DEFAULT_PROVIDER, PROVIDERS } from '$constants/providers';
|
||||||
|
|
||||||
|
|
|
@ -435,13 +435,14 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
||||||
if (!this._markers || this._markers.length <= 2) return;
|
if (!this._markers || this._markers.length <= 2) return;
|
||||||
if (this.constr.is_drawing) return;
|
if (this.constr.is_drawing) return;
|
||||||
|
|
||||||
|
if (_marker.newPointMarker) {
|
||||||
|
this._map.removeLayer(_marker.newPointMarker);
|
||||||
|
}
|
||||||
this._map.removeLayer(_marker);
|
this._map.removeLayer(_marker);
|
||||||
// that._map.removeLayer(newPointMarker);
|
|
||||||
|
|
||||||
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');
|
if (this._options.onPointDropped) this._options.onPointDropped(event, 'dropped');
|
||||||
});
|
});
|
||||||
|
|
||||||
// marker.on(that._options.addFirstLastPointEvent, (event) => {
|
// marker.on(that._options.addFirstLastPointEvent, (event) => {
|
||||||
|
@ -583,8 +584,6 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._options.onPointAdded) this._options.onPointAdded(event);
|
|
||||||
|
|
||||||
const pointNo = (this._markers && this._markers.length) || 0;
|
const pointNo = (this._markers && this._markers.length) || 0;
|
||||||
|
|
||||||
this._addMarkers(pointNo, event.latlng, true);
|
this._addMarkers(pointNo, event.latlng, true);
|
||||||
|
@ -592,6 +591,8 @@ L.Polyline.polylineEditor = L.Polyline.extend({
|
||||||
|
|
||||||
this._map.off('click', this._addPointForward);
|
this._map.off('click', this._addPointForward);
|
||||||
|
|
||||||
|
if (this._options.onPointAdded) this._options.onPointAdded(event);
|
||||||
|
|
||||||
setTimeout(this._prepareForNewPoint.bind(this), 25);
|
setTimeout(this._prepareForNewPoint.bind(this), 25);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue