diff options
Diffstat (limited to 'modern/src/map/Map.js')
-rw-r--r-- | modern/src/map/Map.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modern/src/map/Map.js b/modern/src/map/Map.js index a5f69e0..10630d8 100644 --- a/modern/src/map/Map.js +++ b/modern/src/map/Map.js @@ -20,6 +20,8 @@ element.style.height = '100%'; export const map = new maplibregl.Map({ container: element, + center: [-100.360, 23.191], + zoom: 5 }); let ready = false; @@ -48,13 +50,11 @@ const initMap = async () => { }); await Promise.all(deviceCategories.map(async (category) => { const results = []; - ['green', 'red', 'gray'].forEach((color) => { - results.push(loadImage(`images/icon/${category}.png`).then((icon) => { - map.addImage(`${category}-${color}`, prepareIcon(background, icon, palette.common[color]), { - pixelRatio: window.devicePixelRatio, - }); - })); - }); + results.push(loadImage(`images/icon/${category.toLowerCase()}.png`).then((icon) => { + map.addImage(`${category.toLowerCase()}-map`, prepareIcon(background, icon, null), { + pixelRatio: window.devicePixelRatio, + }); + })); await Promise.all(results); })); } @@ -62,7 +62,7 @@ const initMap = async () => { }; map.addControl(new maplibregl.NavigationControl({ - showCompass: false, + showCompass: false })); const switcher = new SwitcherControl( @@ -70,7 +70,7 @@ const switcher = new SwitcherControl( () => { const waiting = () => { if (!map.loaded()) { - setTimeout(waiting, 100); + setTimeout(waiting, 2000); } else { initMap(); } |