We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37fe87f commit f616cf7Copy full SHA for f616cf7
1 file changed
src/main.ts
@@ -26,14 +26,17 @@ const map = new maplibregl.Map({
26
27
map.addControl(new maplibregl.NavigationControl(), "bottom-right");
28
29
+let mapReady = false;
30
+
31
const { getState } = initControls((state) => {
- if (map.isStyleLoaded()) {
32
+ if (mapReady) {
33
updateLayer(map, state);
34
updateLegend(state);
35
}
36
});
37
38
map.on("load", () => {
39
+ mapReady = true;
40
map.setProjection({ type: "globe" });
41
map.setSky({
42
"sky-color": "#0d1117",
0 commit comments