aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/Map.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-11-01 18:46:57 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-11-01 18:46:57 -0800
commitbee6677be113e4215d07abd54db32dd4fc37b3b0 (patch)
treede10f4e7cc8832038b80b69749173f4f4533a1da /modern/src/map/Map.js
parent47b95d6739d8bfcb2ee285ffaaffc8fc41520f1f (diff)
downloadtrackermap-web-bee6677be113e4215d07abd54db32dd4fc37b3b0.tar.gz
trackermap-web-bee6677be113e4215d07abd54db32dd4fc37b3b0.tar.bz2
trackermap-web-bee6677be113e4215d07abd54db32dd4fc37b3b0.zip
Another switch fix
Diffstat (limited to 'modern/src/map/Map.js')
-rw-r--r--modern/src/map/Map.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/modern/src/map/Map.js b/modern/src/map/Map.js
index 71fb5e56..2bcf04f4 100644
--- a/modern/src/map/Map.js
+++ b/modern/src/map/Map.js
@@ -20,14 +20,19 @@ export const map = new mapboxgl.Map({
let ready = false;
const readyListeners = new Set();
-const addReadyListener = listener => readyListeners.add(listener);
+const addReadyListener = listener => {
+ readyListeners.add(listener);
+ listener(ready);
+};
-const removeReadyListener = listener => readyListeners.delete(listener);
+const removeReadyListener = listener => {
+ readyListeners.delete(listener);
+};
const updateReadyValue = value => {
ready = value;
readyListeners.forEach(listener => listener(value));
-}
+};
const initMap = async () => {
const background = await loadImage('images/background.svg');