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
This commit is contained in:
mz8i 2019-10-01 17:03:08 +01:00 committed by GitHub
parent e10e55fcac
commit ecc928b910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 };
}