From ecc928b910a07de8480fd4029e086a38b9d8e9e7 Mon Sep 17 00:00:00 2001 From: mz8i Date: Tue, 1 Oct 2019 17:03:08 +0100 Subject: [PATCH] Use tile scale cache suffix for scale above 1 only (#440) The tile params formatting is used for caching. Don't add the @1x suffix for scale 1, in order to re-use old cache from before retina tiles were enabled --- app/src/tiles/tileCache.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/tiles/tileCache.ts b/app/src/tiles/tileCache.ts index 11b3020d..27ab060e 100644 --- a/app/src/tiles/tileCache.ts +++ b/app/src/tiles/tileCache.ts @@ -125,7 +125,8 @@ class TileCache { private cacheLocation({tileset, z, x, y, scale}: TileParams): CacheLocation { const dir = `${this.basePath}/${tileset}/${z}/${x}`; - const fname = `${dir}/${y}@${scale}x.png`; + const scaleSuffix = scale === 1 ? '' : `@${scale}x`; + const fname = `${dir}/${y}${scaleSuffix}.png`; return { dir, fname }; }