nakarte

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

commit 0fad88b06d3c42c0c8c88428b2a12d278a9b96ae
parent ccd8a159bef494cacf02323aef7a55ed23dd1a96
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Fri,  3 Nov 2017 12:24:48 +0300

fixed showing two menus when clicking on jnx selector while coordinates control enabled

Diffstat:
Msrc/lib/leaflet.control.coordinates/index.js | 1+
Msrc/lib/leaflet.control.jnx/index.js | 5++++-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/leaflet.control.coordinates/index.js b/src/lib/leaflet.control.coordinates/index.js @@ -159,6 +159,7 @@ L.Control.Coordinates = L.Control.extend({ }, onMapRightClick: function(e) { + L.DomEvent.stop(e); const items = [{text: '<b>Copy coordinates to clipboard</b>', header: true}, '-']; const lat = e.latlng.lat, diff --git a/src/lib/leaflet.control.jnx/index.js b/src/lib/leaflet.control.jnx/index.js @@ -131,7 +131,10 @@ L.Control.JNX = L.Control.extend({ this._selector = new RectangleSelect(bounds) .addTo(this._map) .on('change', () => this.fire('selectionchange')) - .on('click contextmenu', (e) => this.contextMenu.show(e)); + .on('click contextmenu', (e) => { + L.DomEvent.stop(e); + this.contextMenu.show(e) + }); this.fire('selectionchange'); },