From 86a797a75f796c99fdb6b36341ddace7faa3b639 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Sat, 2 Sep 2023 23:23:46 +0200 Subject: [PATCH] Handle flipped y-coordinates --- src/UI/Map/MapLibreAdaptor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index 6193ee7ca..75f2d54d4 100644 --- a/src/UI/Map/MapLibreAdaptor.ts +++ b/src/UI/Map/MapLibreAdaptor.ts @@ -172,7 +172,8 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { tileSize: layer["tile-size"] ?? 256, minzoom: layer["min_zoom"] ?? 1, maxzoom: layer["max_zoom"] ?? 25, - // scheme: background["type"] === "tms" ? "tms" : "xyz", + // Bit of a hack, but seems to work + scheme: layer.url.includes("{-y}") ? "tms" : "xyz", } } @@ -203,6 +204,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { "{width}": "" + size, "{height}": "" + size, "{zoom}": "{z}", + "{-y}": "{y}", } for (const key in toReplace) {