fix(osm): stop using public Overpass by default (#648) (#742)

Traffic roads come from OpenFreeMap vector tiles, or TomTom flow tiles with a
key (Hybrid by default). Military areas use OpenFreeMap polygons with a bundled
worldwide name index; wide views show named points. ALPR reads an hourly
OpenStreetMap extract. Cockpit place context and country, state and US county
outlines use bundled Natural Earth and US Census data. Overpass is used only
when an operator configures their own endpoint.

Also: camera arrivals no longer land below ground, keyless terrain retries on
429, bounded relation geometry for configured Overpass, one shared
OpenStreetMap credit, and separate tile and API transports for embedders.

Co-authored-by: theGaryLarson <[email protected]>
Co-authored-by: Milan Khanal <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-09-28 19:07:57 -05:00
1 parent 81eb44340d
commit f4fcf267c6
200 files changed
+26665 -1977

No files matched your search

+19 -19
View File
@@ -9,7 +9,6 @@ import {
HEAT_JAM_BASE_ALPHA,
HEAT_LINE_SLOW_WIDTH,
TRAFFIC_TIMING_ENABLED,
MAX_DOTS,
} from './policy.js';
export function createRendering({
@@ -161,7 +160,7 @@ export function createRendering({
}
/**
* Clear existing dots and re-spawn them for the given road set and altitude.
* Reconcile road populations without respawning retained dots.
*
* When zoomed out (>5 km), only major road types are rendered to reduce clutter.
* Dot budgets are allocated fairly across visible roads via `allocateRoadDotBudgets`.
@@ -172,14 +171,20 @@ export function createRendering({
* @param {Object|null} [trace=null] - Development-only correlated load trace.
*/
function renderRoadsForAltitude(roads, altitude, label, trace = null) {
function renderRoadsForAltitude(
roads,
altitude,
label,
trace = null,
replace = true,
) {
const state =
TRAFFIC_TIMING_ENABLED && trace
? parts.timing.trafficTimingRenderState(trace, label)
: null;
const renderId = state ? ++trace.renderSequence : null;
parts.animation.clearDots();
layerState._roads = roads;
layerState._lastPaintStage = label;
layerState._lastRenderAltitude = altitude;
// At high altitude, drop minor roads to reduce visual noise
@@ -224,18 +229,13 @@ export function createRendering({
visibleRoadCount: filteredRoads.length,
})
: null;
const roadBudgets = parts.model.allocateRoadDotBudgets(
filteredRoads,
altitude,
MAX_DOTS,
);
for (let i = 0; i < filteredRoads.length; i++) {
const road = filteredRoads[i];
const budget = roadBudgets[i] || 0;
if (budget <= 0) continue;
parts.animation.spawnDotsForRoad(road, altitude, budget);
if (layerState._dots.length >= MAX_DOTS) break;
}
parts.retention.reconcile(filteredRoads, altitude, replace);
if (layerState._dots.length && filteredRoads.some((r) => !r.directFlow))
services.credits?.showOsmCredit?.(layerState._viewer, 'traffic', {
openMapTiles: true,
});
else services.credits?.hideOsmCredit?.(layerState._viewer, 'traffic');
parts.model.recolorDotsInPlace(label);
const renderMetrics = state
? {
@@ -268,7 +268,7 @@ export function createRendering({
renderMetrics,
)
: null;
rebuildHeatLines(filteredRoads);
if (!label.includes('tile')) rebuildHeatLines(filteredRoads);
if (state) {
const heatEnd = parts.timing.trafficTimingMark(
state,
@@ -290,7 +290,7 @@ export function createRendering({
);
}
layerState._count = layerState._dots.length;
parts.retention.refreshCounts();
layerState._lastUpdate = Date.now();
console.log(
`[Data:Traffic] ${label}: ${layerState._count} dots (roads=${roads.length}, alt=${Math.round(altitude)}m)`,