Skip to content

Commit

Permalink
Fix darkmode, adjust basemap attributions
Browse files Browse the repository at this point in the history
  • Loading branch information
ut committed Sep 8, 2024
1 parent 0a599c3 commit 48ad628
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ input.leaflet-control-layers-selector[disabled=""] + span {
#map.leaflet-container .leaflet-control-attribution a {
color: silver;
}
body.light-mode #map.leaflet-container .leaflet-control-attribution,
body.light-mode #map.leaflet-container .leaflet-control-attribution a {
color: #666;
}

#map.leaflet-container a.leaflet-popup-close-button {
right: 5px;
font: 24px/24px Tahoma, Verdana, sans-serif;
Expand Down
9 changes: 6 additions & 3 deletions src/components/LeafletMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default {
})
let hamburg_dark_mode = L.tileLayer('https://tiles.3plusx.io/hamburg/darkmode/{z}/{x}/{y}{r}.png', {
attribution: 'Map by UT/3+x, Geodata by <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>',
attribution: 'Karte: UT/3+x, Geodaten: <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap + Mitwirkende</a>',
maxZoom: 17,
detectRetina: false
})
Expand All @@ -79,7 +79,7 @@ export default {
transparent: true,
minZoom: 9,
maxZoom: 20,
attribution: 'Landesbetriebs Geoinformation und Vermessung (LGV) Hamburg, Datenlizenz Deutschland Namensnennung 2.0'
attribution: 'Karte: LGV Hamburg, Lizenz <a href="https://www.govdata.de/dl-de/by-2-0"> dl-de/by-2-0</a>'
})
Expand All @@ -103,9 +103,10 @@ export default {
document.body.classList.add('dark-mode');
} else if (savedBasemap === 'Hamburg Darkmode') {
hamburg_dark_mode.addTo(map.value)
document.body.classList.remove('dark-mode');
document.body.classList.add('dark-mode');
} else {
wmsLayerHamburg1980s.addTo(map.value)
document.body.classList.remove('dark-mode');
document.body.classList.add('light-mode');
}
Expand Down Expand Up @@ -441,8 +442,10 @@ export default {
console.log('baselayerchange', e);
if (e.name === 'Historische Karte 1980er') {
document.body.classList.add('light-mode');
document.body.classList.remove('dark-mode');
} else {
document.body.classList.remove('light-mode');
document.body.classList.add('dark-mode');
}
saveMapState();
})
Expand Down

0 comments on commit 48ad628

Please sign in to comment.