Re-enable button, add setting to choose how to add new features

This commit is contained in:
Pieter Vander Vennet 2024-06-21 02:36:36 +02:00
parent 25ff4b3a8c
commit 1acb645beb
12 changed files with 124 additions and 110 deletions

View file

@ -148,10 +148,8 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
map.on("click", (e) => {
handleClick(e)
})
map.on("contextmenu", (e) => {
// This one only works on desktop
handleClick(e, "right")
})
// map.on("contextmenu", ...) only works on desktop, hence we listen to the container:
map._container.addEventListener("contextmenu", (e) => {
const lngLat = map.unproject([e.x, e.y])