mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 02:41:09 +00:00
app: disable pointer events on popup unless it is frozen (#537)
This commit is contained in:
@@ -460,6 +460,9 @@ function MaplibreMap(props: { file: PMTiles; mapHashPassed: boolean }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
map.on("click", (e) => {
|
map.on("click", (e) => {
|
||||||
|
popupFrozen
|
||||||
|
? popup.removeClassName("frozen")
|
||||||
|
: popup.addClassName("frozen");
|
||||||
setPopupFrozen((p) => !p);
|
setPopupFrozen((p) => !p);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -61,4 +61,10 @@ export const globalStyles = globalCss({
|
|||||||
color: "$white",
|
color: "$white",
|
||||||
fontFamily: "sans-serif",
|
fontFamily: "sans-serif",
|
||||||
},
|
},
|
||||||
|
".maplibregl-popup .maplibregl-popup-content": {
|
||||||
|
pointerEvents: "none",
|
||||||
|
},
|
||||||
|
".maplibregl-popup.frozen .maplibregl-popup-content": {
|
||||||
|
pointerEvents: "auto",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user