nakarte

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

commit b1338768eecbc19fe2434fee443b51ddb37df7e1
parent be5f8cee85021404c2e9b4d639c7d2264ca85fb1
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Fri, 25 Aug 2017 01:00:36 +0300

[track list] when joining lines set cursor to arrow

Diffstat:
Msrc/lib/leaflet.control.track-list/track-list.css | 8++++++--
Msrc/lib/leaflet.control.track-list/track-list.js | 4+++-
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/lib/leaflet.control.track-list/track-list.css b/src/lib/leaflet.control.track-list/track-list.css @@ -254,4 +254,8 @@ .leaflet-control-tracklist .leaflet-control-button-toggle { background-image: url("images/route.svg"); - } -\ No newline at end of file + } + +.join-line-selecting { + cursor: default; +} +\ No newline at end of file diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js @@ -754,7 +754,7 @@ L.Control.TrackList = L.Control.extend({ var p = this._editedLine.getLatLngs()[e.nodeIndex]; p = [p.lat, p.lng]; this._lineJoinCursor = L.polyline([p, e.mouseEvent.latlng], { - clickable: false, + interactive: false, color: 'red', weight: 1.5, opacity: 1, @@ -764,6 +764,7 @@ L.Control.TrackList = L.Control.extend({ .addTo(this.map); this.map.on('mousemove', this.onMouseMoveUpdateLineJoinCursor, this); this.map.on('click', this.stopLineJoinSelection, this); + L.DomUtil.addClass(this.map.getContainer(), 'join-line-selecting'); L.DomEvent.on(document, 'keyup', this.onEscPressedStopLineJoinSelection, this); var self = this; setTimeout(function() { @@ -814,6 +815,7 @@ L.Control.TrackList = L.Control.extend({ if (this._lineJoinCursor) { this.map.off('mousemove', this.onMouseMoveUpdateLineJoinCursor, this); this.map.off('click', this.stopLineJoinSelection, this); + L.DomUtil.removeClass(this.map.getContainer(), 'join-line-selecting'); L.DomEvent.off(document, 'keyup', this.onEscPressedStopLineJoinSelection, this); this.map.removeLayer(this._lineJoinCursor); this._lineJoinCursor = null;