Skip to content

Commit 2bda2cb

Browse files
committed
only allow one 'add to layer' item
1 parent be93a1e commit 2bda2cb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/javascript/maplibre/layers/basemap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class BasemapLayer extends Layer {
5353

5454
if (features.length) {
5555
functions.e('#map-context-menu', el => {
56+
if (el.querySelector('[data-action*="addToGeojsonLayer"]')) { return }
5657
el.classList.remove('hidden')
5758

5859
const copyButton = document.createElement('div')

app/javascript/maplibre/layers/overpass.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class OverpassLayer extends Layer {
3838
const feature = features.find(f => !f.properties?.cluster)
3939
if (feature) {
4040
functions.e('#map-context-menu', el => {
41+
if (el.querySelector('[data-action*="addToGeojsonLayer"]')) { return }
4142
el.classList.remove('hidden')
4243
const copyButton = document.createElement('div')
4344
copyButton.classList.add('context-menu-item')

0 commit comments

Comments
 (0)