diff --git a/tasks/enduro-trails/prototype/static/index.html b/tasks/enduro-trails/prototype/static/index.html index 0b1aabd..e9937a0 100644 --- a/tasks/enduro-trails/prototype/static/index.html +++ b/tasks/enduro-trails/prototype/static/index.html @@ -348,6 +348,7 @@ const map = new maplibregl.Map({ maxZoom: 18, hash: true, }); +window._map = map; map.addControl(new maplibregl.NavigationControl(), 'top-left'); map.addControl(new maplibregl.ScaleControl({ unit: 'metric' }), 'bottom-right'); @@ -360,9 +361,16 @@ map.on('load', () => { }); map.on('error', (e) => { - console.warn('Map error:', e); + console.error('Map error:', e.error?.message || e); + // Снимаем loading даже при ошибке чтобы не висело + document.getElementById('loading').classList.remove('visible'); }); +// Таймаут — если load не сработал за 15 сек, снимаем loading +setTimeout(() => { + document.getElementById('loading').classList.remove('visible'); +}, 15000); + // ─── Check if data is available ─────────────────────────────────────────────── async function checkDataAvailability() { try { diff --git a/tasks/enduro-trails/prototype/static/style.json b/tasks/enduro-trails/prototype/static/style.json index c15fe02..023cf84 100644 --- a/tasks/enduro-trails/prototype/static/style.json +++ b/tasks/enduro-trails/prototype/static/style.json @@ -77,7 +77,7 @@ "type": "line", "source": "trails-tiles", "source-layer": "trails", - "filter": ["in", ["get", "highway"], "literal", ["path", "bridleway", "footway"]], + "filter": ["in", "highway", "path", "bridleway", "footway"], "paint": { "line-color": "#cc9900", "line-width": ["interpolate", ["linear"], ["zoom"], 7, 0.5, 10, 1, 12, 1.5, 16, 3],