feat(street-level): one colour per imagery source

As more sources arrive, each one reads the same everywhere it appears: its
PROVIDERS chip, coverage lines, overview points, image cones and a single
legend swatch. The palette lives in one place, PROVIDER_COLORS in
src/layers/streetLevel/policy.js: Mapillary green (#05cb63), Panoramax
purple, Google Street View blue.

Mapillary drops its age dimming and magenta panoramas: lines and overview
points are Mapillary green, cones are green too and 360° images keep their
ring shape; the 360°/FLAT filter still separates them, and the selected
sequence stays GEV cyan.

The provider contract loses `legend`: `colors.coverage` is the source's one
colour, and the core composes the legend as one swatch per active source
(its name, its colour) followed by Selected. The chip group takes an
optional per-chip colour as a `--chip-color` CSS variable, written only
when it changes; Street Level chips show it as a swatch dot and, while on,
as the chip's border, text and a faint fill.

The feature gate checks the legend has one swatch per source plus Selected
and that the Mapillary chip carries #05cb63.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Said TurkseverandClaude Opus 5.5 committed 2026-09-29 00:03:00 +01:00
1 parent d5da45eacb
commit 0f2cac2ca2
21 files changed
+188 -99

No files matched your search

@@ -1,4 +1,4 @@
import { COLORS as SHARED_COLORS } from '../../policy.js';
import { COLORS as SHARED_COLORS, PROVIDER_COLORS } from '../../policy.js';
/** Identity and tuning for the Mapillary street-level provider. */
export const MAPILLARY_PROVIDER_ID = 'mapillary';
@@ -14,13 +14,13 @@ export const PICK_PREFIX = Object.freeze({
image: 'mly:img:',
});
/** Brand green for coverage; panoramas get a distinct hue; selection is GEV cyan. */
/**
* Mapillary draws in one colour, its brand green, for lines, overview points
* and cones alike (360° cones keep their ring shape); selection is GEV cyan.
*/
export const COLORS = Object.freeze({
coverage: '#05cb63',
coverageOld: '#2e7d5b',
pano: '#ff4fd8',
coverage: PROVIDER_COLORS.mapillary,
selected: SHARED_COLORS.selected,
image: '#e8eaed',
});
/** Camera-driven coverage refresh. */
@@ -31,8 +31,6 @@ export const COVERAGE_OVERVIEW_MAX_TILES = 16;
export const COVERAGE_OVERVIEW_POINT_PX = 2.5;
export const COVERAGE_MAX_SEQUENCES = 6000;
export const COVERAGE_LINE_WIDTH_PX = 2.5;
/** Sequences newer than this many days draw at full brightness. */
export const COVERAGE_RECENT_DAYS = 730;
/** Per-sequence image cones after a sequence is selected. */
export const SEQUENCE_IMAGES_LIMIT = 2000;
@@ -50,17 +48,6 @@ export const NEAREST_LIMIT = 8;
export const MAPILLARY_CREDIT_HTML =
'Street Level: imagery © <a href="https://www.mapillary.com" target="_blank" rel="noopener">Mapillary</a> contributors, CC BY-SA 4.0';
/** Coverage colour key, in the order the panel lists it. */
export const MAPILLARY_LEGEND = Object.freeze([
Object.freeze({
key: 'recent',
label: `Recent (≤${Math.round(COVERAGE_RECENT_DAYS / 365)} yr)`,
color: COLORS.coverage,
}),
Object.freeze({ key: 'older', label: 'Older', color: COLORS.coverageOld }),
Object.freeze({ key: 'pano', label: '360°', color: COLORS.pano }),
]);
/** Deep link to an image on mapillary.com, as the web app shares them. */
export function mapillaryImageUrl(imageId) {
const id = String(imageId || '').trim();