UI: Replace CARTO basemaps with OpenStreetMap to remove API KEY REQUIRED warning
This commit is contained in:
1 parent
3c2dc831a1
commit
ac48bf4585
3 files changed
+8
-6
No files matched your search
@@ -107,10 +107,11 @@ const AgentLocationMap = React.memo(function AgentLocationMap({
|
||||
});
|
||||
instanceRef.current = map;
|
||||
|
||||
L.tileLayer("https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png", {
|
||||
subdomains: "abcd",
|
||||
maxZoom: 20,
|
||||
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||
subdomains: "abc",
|
||||
maxZoom: 19,
|
||||
noWrap: true,
|
||||
className: "dark-map-tiles"
|
||||
}).addTo(map);
|
||||
|
||||
if (pins.length > 1) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export const MAP_CSS = `
|
||||
.dark-map-tiles { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }
|
||||
.leaflet-control-attribution { display:none !important; }
|
||||
.agent-popup .leaflet-popup-content-wrapper { background:#0a1224!important; border:1px solid rgba(99,102,241,0.25)!important; box-shadow:0 12px 36px rgba(0,0,0,0.65)!important; padding:0!important; border-radius:12px!important; }
|
||||
.agent-popup .leaflet-popup-content { margin:0!important; }
|
||||
|
||||
@@ -82,8 +82,8 @@ export async function bootMapInstance({
|
||||
const centerLng = 0;
|
||||
|
||||
const tileUrl = isDark
|
||||
? "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png"
|
||||
: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png";
|
||||
? "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
||||
|
||||
if (!mapInstanceRef.current) {
|
||||
const map = L.map(mapContainer, {
|
||||
@@ -94,7 +94,7 @@ export async function bootMapInstance({
|
||||
markerZoomAnimation: false,
|
||||
}).setView([centerLat, centerLng], 2, { animate: false }); // Zoom 2 for global view
|
||||
|
||||
const tiles = L.tileLayer(tileUrl, { maxZoom: 19 }).addTo(map);
|
||||
const tiles = L.tileLayer(tileUrl, { maxZoom: 19, className: isDark ? 'dark-map-tiles' : '' }).addTo(map);
|
||||
tileLayerRef.current = tiles;
|
||||
L.control.zoom({ position: "bottomright" }).addTo(map);
|
||||
mapInstanceRef.current = map;
|
||||
|
||||
Reference in new issue
Block a user