From 45b80fc096549c1ba5279d104f1c977723865124 Mon Sep 17 00:00:00 2001 From: Mustafa Taha Şahin Date: Wed, 31 Mar 2021 01:41:22 +0300 Subject: Added tileSize attribute for OSM map style --- modern/src/map/mapStyles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modern/src') diff --git a/modern/src/map/mapStyles.js b/modern/src/map/mapStyles.js index ff323cb3..5a4ee10a 100644 --- a/modern/src/map/mapStyles.js +++ b/modern/src/map/mapStyles.js @@ -1,10 +1,11 @@ -export const styleCustom = (url, attribution) => ({ +export const styleCustom = (url, attribution, tileSize) => ({ version: 8, sources: { osm: { type: 'raster', tiles: [url], attribution: attribution, + tileSize: tileSize, }, }, glyphs: 'https://cdn.traccar.com/map/fonts/{fontstack}/{range}.pbf', @@ -18,6 +19,7 @@ export const styleCustom = (url, attribution) => ({ export const styleOsm = () => styleCustom( 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', '© OpenStreetMap contributors', + 256, ); export const styleCarto = () => ({ -- cgit v1.2.3 From 558c85890e7da58be0b66b24837946a8d54314b4 Mon Sep 17 00:00:00 2001 From: Mustafa Taha Şahin Date: Wed, 31 Mar 2021 03:10:30 +0300 Subject: hardcode 256 for OSM tileSize --- modern/src/map/mapStyles.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'modern/src') diff --git a/modern/src/map/mapStyles.js b/modern/src/map/mapStyles.js index 5a4ee10a..00a8666d 100644 --- a/modern/src/map/mapStyles.js +++ b/modern/src/map/mapStyles.js @@ -1,11 +1,11 @@ -export const styleCustom = (url, attribution, tileSize) => ({ +export const styleCustom = (url, attribution) => ({ version: 8, sources: { osm: { type: 'raster', tiles: [url], attribution: attribution, - tileSize: tileSize, + tileSize: 256, }, }, glyphs: 'https://cdn.traccar.com/map/fonts/{fontstack}/{range}.pbf', @@ -19,7 +19,6 @@ export const styleCustom = (url, attribution, tileSize) => ({ export const styleOsm = () => styleCustom( 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', '© OpenStreetMap contributors', - 256, ); export const styleCarto = () => ({ -- cgit v1.2.3