prevent pasting when map features are hidden (#10000)

This commit is contained in:
Kyℓe Hensel
2025-01-15 22:24:14 +11:00
committed by GitHub
parent 172aeb6e57
commit e5666564e1

View File

@@ -11,6 +11,10 @@ export function behaviorPaste(context) {
// prevent paste during low zoom selection
if (!context.map().withinEditableZoom()) return;
// prevent paste if the pasted object would be invisible (see #10000)
const isOsmLayerEnabled = context.layers().layer('osm').enabled();
if (!isOsmLayerEnabled) return;
d3_event.preventDefault();
var baseGraph = context.graph();