diff --git a/www/app.js b/www/app.js index d20fbfc..f1b9ebf 100644 --- a/www/app.js +++ b/www/app.js @@ -3,16 +3,16 @@ import * as THREE from 'three'; import * as LocAR from 'locar'; -import { PYLON_TYPES } from './pylon.js?v=46'; -import { BuildingOccluders } from './buildings.js?v=46'; -import { LidarOccluders } from './lidar.js?v=46'; -import { Terrain, TerrainOccluders } from './terrain.js?v=46'; -import { registerServiceWorker, offlineSupported, offlineStatus, downloadAll, clearOffline, sourceSize } from './offline.js?v=46'; +import { PYLON_TYPES } from './pylon.js?v=47'; +import { BuildingOccluders } from './buildings.js?v=47'; +import { LidarOccluders } from './lidar.js?v=47'; +import { Terrain, TerrainOccluders } from './terrain.js?v=47'; +import { registerServiceWorker, offlineSupported, offlineStatus, downloadAll, clearOffline, sourceSize } from './offline.js?v=47'; import { LineSegments2 } from './lib/lines/LineSegments2.js'; import { LineSegmentsGeometry } from './lib/lines/LineSegmentsGeometry.js'; import { LineMaterial } from './lib/lines/LineMaterial.js'; -const APP_VERSION = 'v46'; // affichée à gauche de l'indication « Tourne à… » +const APP_VERSION = 'v47'; // affichée à gauche de l'indication « Tourne à… » // --------------------------------------------------------------------------- // Configuration @@ -1207,11 +1207,20 @@ occlSel.addEventListener('change', () => setOcclSrc(occlSel.value)); const clearIn = document.getElementById('clear-r'), clearOut = document.getElementById('clear-out'); clearIn.value = clearOut.textContent = clearRadius; clearIn.addEventListener('input', () => { clearRadius = +clearIn.value; clearOut.textContent = clearRadius; savePref('bdh-clear2', clearRadius); }); +// Précision non publiée sur ce site (ex. « Très précis », 83 Mo, absent de l'hébergement principal) : +// on retire le choix partout et on revient à « Moyen » s'il était sélectionné. +function hideOcclSource(k) { + document.querySelector(`input[name="occl-prec"][value="${k}"]`)?.closest('label')?.remove(); + [...occlSel.options].find((o) => o.value === k)?.remove(); + document.querySelector(`#dl-choices button[data-src="${k}"]`)?.remove(); + if (occlSrc === k) setOcclSrc('lidar2'); +} // Tailles de téléchargement complet affichées à côté de chaque choix // (relief du terrain 3,8 Mo toujours compris ; avec le LiDAR, + bâtiments OSM) Promise.all([sourceSize(TERRAIN_SRC), ...Object.entries(OCCL_SOURCES).map(async ([k, s]) => [k, await sourceSize(s)])]).then(([tsz, ...list]) => { const osmBytes = list.find(([k]) => k === 'osm')?.[1]?.bytes || 0; for (const [k, sz] of list) { + if (sz?.missing) { hideOcclSource(k); continue; } const txt = sz ? fmtMB(sz.bytes + (tsz?.bytes || 0) + (k === 'osm' ? 0 : osmBytes)) : 'indisponible'; const el = document.getElementById(`size-${k}`); if (el) el.textContent = txt; diff --git a/www/buildings.js b/www/buildings.js index 7754eeb..0b0e6c4 100644 --- a/www/buildings.js +++ b/www/buildings.js @@ -9,7 +9,7 @@ // dans la même projection locale que l'app (équirectangulaire, LAT0 = 50,6°). import * as THREE from 'three'; -import { withClearZone } from './terrain.js?v=46'; +import { withClearZone } from './terrain.js?v=47'; const TILE = 1000; // m diff --git a/www/index.html b/www/index.html index 178dfe4..3e765da 100644 --- a/www/index.html +++ b/www/index.html @@ -10,7 +10,7 @@