Bike Share marks its covered cities on the globe

Above the height stations draw at, the layer only said "Fly below 48 km to
a covered city" without showing which cities those are. Every system in
the registry now has a marker there: a green, white-ringed dot over its
city, 5 km up so terrain never hides it, shown only while the layer is on
and stations are not drawn.

Clicking a marker flies straight down into its city from 20 km, as an
explicit camera action through the shell's runNavigation, like News and
the weather layers. The markers belong to the layer for picking.
This commit is contained in:
Sameh Khamis committed 2026-11-17 20:30:04 -08:00
1 parent 09cead6a0e
commit 8fe4be484f
9 files changed
+285 -2

No files matched your search

+15
View File
@@ -115,6 +115,18 @@ export function createViewport({ state: layerState, services, parts, source }) {
parts.rendering.removeCityPoints(cityId);
}
/**
* Show the covered cities' markers, or hide them: shown while the layer is
* on and the camera is too high for stations.
* @param {boolean} shown
*/
function showCoverage(shown) {
const set = layerState._coverageSet;
if (!set || set.show === shown) return;
set.show = shown;
governorRequestRender('bikeshare-coverage');
}
/** Repaint the row now: it follows the camera, the manager tick is 60 s. */
function refreshRow() {
layerState._dataManager?.refreshLayerStats?.('bikeshare');
@@ -212,11 +224,13 @@ export function createViewport({ state: layerState, services, parts, source }) {
const wasGateEnabled = layerState._altitudeGateEnabled;
// Altitude gate: disable all cities when camera is too high
if (!shouldActivateAtAltitude(altitude)) {
showCoverage(true);
deactivateAllCities();
if (wasGateEnabled) refreshRow();
return;
}
showCoverage(false);
const center = getCameraCenterLatLon(layerState._viewer);
if (!center) return;
@@ -288,6 +302,7 @@ export function createViewport({ state: layerState, services, parts, source }) {
activateCity,
runProximityCheck,
scheduleProximityCheck,
showCoverage,
onCameraChanged,
};
}