aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/map/Map.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/modern/src/map/Map.js b/modern/src/map/Map.js
index 2bcf04f..a718798 100644
--- a/modern/src/map/Map.js
+++ b/modern/src/map/Map.js
@@ -37,8 +37,10 @@ const updateReadyValue = value => {
const initMap = async () => {
const background = await loadImage('images/background.svg');
await Promise.all(deviceCategories.map(async category => {
- const imageData = await loadIcon(category, background, `images/icon/${category}.svg`);
- if (!map.hasImage(category)) map.addImage(category, imageData, { pixelRatio: window.devicePixelRatio });
+ if (!map.hasImage(category)) {
+ const imageData = await loadIcon(category, background, `images/icon/${category}.svg`);
+ map.addImage(category, imageData, { pixelRatio: window.devicePixelRatio });
+ }
}));
updateReadyValue(true);
};