Split summary-server constant

This commit is contained in:
Pieter Vander Vennet 2024-06-12 15:03:10 +02:00
parent d434ed0492
commit 8f5be4f742
4 changed files with 5 additions and 3 deletions

View file

@ -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/",

View file

@ -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) {

View file

@ -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,

View file

@ -28,7 +28,7 @@ async function timeout(timeMS: number): Promise<{ layers: string[] }> {
async function getAvailableLayers(): Promise<Set<string>> {
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),