fix(maps): one imagery choice per map, not one for two of them
The world map and the grid-square map shared a single key, so picking satellite imagery to look at grids repainted the main map too, and there was no way to have terrain on one and streets on the other. They are different maps answering different questions, and the imagery that suits one is not the imagery that suits the next. Four keys now, one per map, in lib/mapBase beside the remembered views — named in one place so a rename cannot silently orphan somebody's choice — and portable, so a copied data folder brings them along. The grid map inherits whatever was set under the old shared key rather than being reset to the default: an operator who chose imagery there keeps it.
This commit is contained in:
@@ -6,6 +6,7 @@ import { BASEMAPS, type BasemapKey } from '@/components/MainMap';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useI18n } from '@/lib/i18n';
|
||||
import { loadMapView, saveMapView, MAP_VIEW_FT } from '@/lib/mapView';
|
||||
import { loadMapBase, saveMapBase, MAP_BASE_FT } from '@/lib/mapBase';
|
||||
|
||||
// FT Map — the live decode feed as geography: every station decoded in the
|
||||
// last half hour, an arc from the operator's own square to theirs, coloured by
|
||||
@@ -128,7 +129,7 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
};
|
||||
baseRef.current = L.tileLayer(bm.url, { ...opts, attribution: bm.attr, subdomains: bm.subdomains ?? 'abc' }).addTo(m);
|
||||
if (bm.labelsUrl) labelsRef.current = L.tileLayer(bm.labelsUrl, opts).addTo(m);
|
||||
localStorage.setItem('opslog.ftmapBase', basemap);
|
||||
saveMapBase(MAP_BASE_FT, basemap);
|
||||
}, [basemap]);
|
||||
|
||||
// The arcs, redrawn when the decode list changes. Newest last so they paint
|
||||
|
||||
Reference in New Issue
Block a user