diff --git a/package.json b/package.json index b5020986c0..9ef5666714 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "url": "https://www.openstreetmap.org" }, "mvt_layer_server": "https://cache.mapcomplete.org/public.{type}_{layer}/{z}/{x}/{y}.pbf", + "#summary_server": "Should be the endpoint; appending status.json should work", + "summary_server": "https://cache.mapcomplete.org/", "disabled:oauth_credentials": { "##": "DEV", "#": "This client-id is registered by 'MapComplete' on https://master.apis.dev.openstreetmap.org/", diff --git a/src/Models/Constants.ts b/src/Models/Constants.ts index d13b6f75d2..4f9894c40e 100644 --- a/src/Models/Constants.ts +++ b/src/Models/Constants.ts @@ -164,6 +164,7 @@ export default class Constants { */ public static VectorTileServer: string | undefined = Constants.config.mvt_layer_server public static readonly maptilerApiKey = "GvoVAJgu46I5rZapJuAy" + public static readonly SummaryServer: string = Constants.config.summary_server private static isRetina(): boolean { if (Utils.runningFromConsole) { diff --git a/src/Models/ThemeViewState.ts b/src/Models/ThemeViewState.ts index 9ae12e26c8..d76c843185 100644 --- a/src/Models/ThemeViewState.ts +++ b/src/Models/ThemeViewState.ts @@ -690,9 +690,8 @@ export default class ThemeViewState implements SpecialVisualizationState { l.source.geojsonSource === undefined && l.doCount ) - const url = new URL(Constants.VectorTileServer) const summaryTileSource = new SummaryTileSource( - url.protocol + "//" + url.host + "/summary", + Constants.SummaryServer, layers.map((l) => l.id), this.mapProperties.zoom.map((z) => Math.max(Math.floor(z), 0)), this.mapProperties, diff --git a/src/index.ts b/src/index.ts index 2d5a1a03ae..10e28cc55b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,7 @@ async function timeout(timeMS: number): Promise<{ layers: string[] }> { async function getAvailableLayers(): Promise> { try { - const host = new URL(Constants.VectorTileServer).host + const host = new URL(Constants.SummaryServer).host const status: { layers: string[] } = await Promise.any([ Utils.downloadJson<{layers}>("https://" + host + "/summary/status.json"), timeout(2500),