added notifications for hidden markers

This commit is contained in:
muerwre 2019-02-11 16:42:52 +07:00
parent 32e1b4c3fd
commit ba5e24a56d
12 changed files with 89 additions and 19 deletions

View file

@ -15,7 +15,7 @@ import {
setAddress,
setChanged,
setDistance,
setLogo,
setLogo, setMarkersShown,
setMode,
setPublic,
setRouterPoints,
@ -115,6 +115,10 @@ export class Editor {
setAddress = value => store.dispatch(setAddress(value));
setPublic = value => store.dispatch(setPublic(value));
setMarkersShown = value => {
if (store.getState().user.markers_shown !== value) store.dispatch(setMarkersShown(value));
};
resetSaveDialog = () => store.dispatch(resetSaveDialog());
setDistance = value => {

View file

@ -20,7 +20,7 @@ export class NewPoly {
this.poly = L.Polyline.PolylineEditor(coordinates, {
...polyStyle,
maxMarkers: 50,
maxMarkers: 100,
onPointsSet: this.updateMarks,
onMarkerDragEnd: this.updateMarks,
@ -28,8 +28,8 @@ export class NewPoly {
onPointDropped: this.updateMarks,
onContinueDrawing: this.setModeOnDrawing,
onMarkersHide: () => console.log('all markers are hidden'),
onMarkersShow: () => console.log('all markers are visible'),
onMarkersHide: () => editor.setMarkersShown(false),
onMarkersShow: () => editor.setMarkersShown(true),
}).addTo(map);
this.poly.addTo(map);