diff --git a/src/adapters/http.ts b/src/adapters/http.ts index 962e497..44e5f22 100644 --- a/src/adapters/http.ts +++ b/src/adapters/http.ts @@ -167,6 +167,12 @@ export function createTeraClient(options: TeraApiOptions = {}): TeraClient { async markers(): Promise { const body = await get("/markers"); if (!body || !Array.isArray(body.markers)) return sampleMarkerFeed(); + // An API that answers with nothing is the default posture of a server + // whose marker source has not been configured, and it is indistinguishable + // to a viewer from a broken map. Fall back, and — more importantly — go on + // saying "sample", because the alternative is an empty map wearing a + // "live data" badge, which is the one outcome worse than no badge at all. + if (body.markers.length === 0) return sampleMarkerFeed(); return { // A `WireMarker` *is* a `Marker` with a provenance field on it, so this // is a widening and not a translation — which is the property