nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit b34fefedaf79726bd0847745733c930b8cccc5f7
parent 25ed982035d42f3474183348d681c34f79af1472
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Fri,  9 Nov 2018 22:56:05 +0100

stop adding waypoints when new track is created; do not stop placing points when other track visibility changes #167

Diffstat:
Msrc/lib/leaflet.control.track-list/track-list.js | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js @@ -205,6 +205,7 @@ L.Control.TrackList = L.Control.extend({ this.url(''); } } + this.stopPlacingPoint(); var track = this.addTrack({name: name}), line = this.addTrackSegment(track); this.startEditTrackSegement(track, line); @@ -322,8 +323,10 @@ L.Control.TrackList = L.Control.extend({ this.map.addLayer(track.feature); this._markerLayer.addMarkers(track.markers); } else { + if (this.trackAddingPoint() === track) { + this.stopPlacingPoint(); + } this.map.removeLayer(track.feature); - this.stopPlacingPoint(); this._markerLayer.removeMarkers(track.markers); } }, @@ -1021,7 +1024,6 @@ L.Control.TrackList = L.Control.extend({ removeTrack: function(track) { track.visible(false); this.tracks.remove(track); - this.stopPlacingPoint(); }, deleteAllTracks: function() {