Skip to content

Commit 460a885

Browse files
committed
Expanded CSS selectors in index.html:37-54: Added aggressive selectors including body.cursor-crosshair * as a catch-all, plus specific Leaflet classes like .leaflet-grabbing, .leaflet-overlay-pane, .leaflet-tile-pane, .leaflet-tile, .leaflet-proxy, and .leaflet-zoom-animated. Also added a separate .leaflet-crosshair class that gets applied directly to the Leaflet container.
Direct Leaflet container targeting in index.js:311-329: The updateMapCursor() function now also adds/removes a leaflet-crosshair class directly to the Leaflet map container via state.photoMap.getContainer(). This provides maximum CSS specificity by targeting the container itself.
1 parent 7da00a4 commit 460a885

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,25 @@
3434
padding: 3px 10px;
3535
font-size: 13px;
3636
}
37+
/* Force crosshair cursor in precision modes - must override Leaflet's inline styles */
38+
body.cursor-crosshair,
39+
body.cursor-crosshair *,
3740
body.cursor-crosshair .leaflet-container,
3841
body.cursor-crosshair .leaflet-grab,
42+
body.cursor-crosshair .leaflet-grabbing,
3943
body.cursor-crosshair .leaflet-dragging,
4044
body.cursor-crosshair .leaflet-interactive,
45+
body.cursor-crosshair .leaflet-overlay-pane,
4146
body.cursor-crosshair .leaflet-pane,
4247
body.cursor-crosshair .leaflet-image-layer,
43-
body.cursor-crosshair.leaflet-dragging {
48+
body.cursor-crosshair .leaflet-tile-pane,
49+
body.cursor-crosshair .leaflet-tile,
50+
body.cursor-crosshair .leaflet-proxy,
51+
body.cursor-crosshair .leaflet-zoom-animated,
52+
.leaflet-container.leaflet-crosshair,
53+
.leaflet-container.leaflet-crosshair .leaflet-interactive,
54+
.leaflet-container.leaflet-crosshair .leaflet-pane,
55+
.leaflet-container.leaflet-crosshair .leaflet-image-layer {
4456
cursor: crosshair !important;
4557
}
4658
</style>

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,15 @@ function updateMapCursor() {
317317

318318
if (isAnyModeActive) {
319319
document.body.classList.add('cursor-crosshair');
320+
// Also add to Leaflet container directly for maximum specificity
321+
if (state.photoMap && state.photoMap.getContainer) {
322+
state.photoMap.getContainer().classList.add('leaflet-crosshair');
323+
}
320324
} else {
321325
document.body.classList.remove('cursor-crosshair');
326+
if (state.photoMap && state.photoMap.getContainer) {
327+
state.photoMap.getContainer().classList.remove('leaflet-crosshair');
328+
}
322329
}
323330
}
324331

0 commit comments

Comments
 (0)