Support dark mode fully in live map (#225)

* Update style.css

* dark mode map

Co-authored-by: Uskompuf <22492406+Uskompuf@users.noreply.github.com>
pull/249/head
Luke Prior 2021-10-24 08:32:33 +11:00 zatwierdzone przez GitHub
rodzic 391135ba9d
commit ad96dd6023
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 21 dodań i 5 usunięć

Wyświetl plik

@ -14,11 +14,20 @@ $(document).ready(function(){
L.control.scale().addTo(map);
L.control.attribution({prefix:false}).addTo(map);
var osm = L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
attribution: '<div><a href="https://leafletjs.com/">Leaflet</a> &middot; Map: <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a></div>',
minZoom: 1,
maxZoom: 19
});
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
var osm = L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',
minZoom: 1,
maxZoom: 19
});
} else {
var osm = L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
attribution: '<div><a href="https://leafletjs.com/">Leaflet</a> &middot; Map: <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a></div>',
minZoom: 1,
maxZoom: 19
});
}
var esri = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: '<div><a href="https://leafletjs.com/">Leaflet</a> &middot; Map: <a href="https://www.esri.com/">Esri</a> &middot; Earthstar Geographics</div>',
minZoom: 1,

Wyświetl plik

@ -370,4 +370,11 @@ p{
color: white;
background-color: grey;
}
.leaflet-bar a {
background-color: grey !important;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
color: white !important;
background: grey !important;
}
}