mirror of
https://github.com/smittix/intercept.git
synced 2026-07-25 01:08:11 -07:00
feat: Centralize map tile management via Settings manager
- Add Settings.registerMap() to register maps for tile updates - Add Settings.createTileLayer() to create tile layers from settings - Update _updateMapTiles() to use registered maps - Expose all maps to window object for settings manager access - All dashboards now use Settings manager when available - Tile provider changes in settings now apply immediately to all maps - Use Fastly CDN for CARTO tiles (more reliable) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,12 +92,19 @@ const Meshtastic = (function() {
|
||||
const defaultLon = -98.5795;
|
||||
|
||||
meshMap = L.map('meshMap').setView([defaultLat, defaultLon], 4);
|
||||
window.meshMap = meshMap;
|
||||
|
||||
// Dark themed map tiles
|
||||
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png?v=2', {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||
maxZoom: 19
|
||||
}).addTo(meshMap);
|
||||
// Use settings manager for tile layer (allows runtime changes)
|
||||
if (typeof Settings !== 'undefined' && Settings.createTileLayer) {
|
||||
Settings.createTileLayer().addTo(meshMap);
|
||||
Settings.registerMap(meshMap);
|
||||
} else {
|
||||
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||
maxZoom: 19,
|
||||
subdomains: 'abcd'
|
||||
}).addTo(meshMap);
|
||||
}
|
||||
|
||||
// Handle resize
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user