From 38f22424260e0b72d8c1fa6562e25c7c325ba952 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 5 Sep 2020 18:40:16 +0200 Subject: [PATCH] Add long-hold/right-click behaviour to add a point (e.g. in an already existing polygon) --- Logic/Leaflet/Basemap.ts | 6 ++++++ State.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Logic/Leaflet/Basemap.ts b/Logic/Leaflet/Basemap.ts index 6d38dce4d..f24a6ece2 100644 --- a/Logic/Leaflet/Basemap.ts +++ b/Logic/Leaflet/Basemap.ts @@ -114,6 +114,12 @@ export class Basemap { this.map.on("click", function (e) { self.LastClickLocation.setData({lat: e.latlng.lat, lon: e.latlng.lng}) }); + + this.map.on("contextmenu", function (e) { + self.LastClickLocation.setData({lat: e.latlng.lat, lon: e.latlng.lng}); + console.log("Right click") + e.preventDefault(); + }); } } diff --git a/State.ts b/State.ts index 3a7acc9ec..889950355 100644 --- a/State.ts +++ b/State.ts @@ -23,7 +23,7 @@ export class State { // The singleton of the global state public static state: State; - public static vNumber = "0.0.7g"; + public static vNumber = "0.0.7h"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = {