Skip to content

Commit 22186f9

Browse files
committed
fix relative import/url issue in css background image
1 parent 5cb625a commit 22186f9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/App.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ body {
6161
}
6262

6363
// customize zoom button styles
64-
$background-size: 64px;
6564
$border-radius: 6px;
6665

6766
.leaflet-bottom .leaflet-control {
@@ -75,20 +74,20 @@ $border-radius: 6px;
7574
border-bottom: none;
7675
background-color: unset;
7776
}
77+
78+
.leaflet-touch .leaflet-bar a {
79+
background-size: 64px;
80+
}
7881
.leaflet-touch .leaflet-bar a:first-child {
7982
border-top-left-radius: $border-radius;
8083
border-top-right-radius: $border-radius;
8184

82-
background-image: url(http://localhost:3000//LUTI_Zoom_Icon.svg);
83-
background-size: $background-size;
8485
background-position: top -10px left -15px;
8586
}
8687
.leaflet-touch .leaflet-bar a:last-child {
8788
border-bottom-left-radius: $border-radius;
8889
border-bottom-right-radius: $border-radius;
8990

90-
background-image: url(http://localhost:3000//LUTI_Zoom_Icon.svg);
91-
background-size: $background-size;
9291
background-position: bottom -11px left -15px;
9392
}
9493
.leaflet-touch .leaflet-bar a:hover {

src/components/InfoBox.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ export default function InfoBox({ desc, displayMode, title, url }) {
1616

1717
const ref = useRef(null);
1818

19+
useEffect(() => {
20+
const controlLinks = document.querySelector(
21+
".leaflet-touch .leaflet-bar a:last-child"
22+
); // this except use the new buttons
23+
if (!controlLinks) return;
24+
25+
controlLinks.style.backgroundImage = "url(/LUTI_Zoom_Icon.svg)";
26+
}, []);
27+
1928
useEffect(() => {
2029
const intro = document.querySelector(".leaflet-control-zoom"); // this except use the new buttons
2130
const height = ref.current.clientHeight;

0 commit comments

Comments
 (0)