We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents be66eac + 4cddfaf commit b607893Copy full SHA for b607893
1 file changed
app/components/Map.js
@@ -30,6 +30,11 @@ const MapComponent = ({
30
return () => newMap.remove();
31
}, []);
32
33
+ useEffect(() => {
34
+ if (!map) return;
35
+ map.setStyle(style);
36
+ }, [map, style]);
37
+
38
useEffect(() => {
39
if (!map) {
40
return () => {};
@@ -50,7 +55,8 @@ const MapComponent = ({
50
55
map.off("zoomend", onChange);
51
56
map.off("moveend", onChange);
52
57
};
53
- }, [map]);
58
+ }, [map, updateViewport]);
59
54
60
return (
61
<div ref={mapContainerRef} style={{width: "100%", height: "100%"}}>
62
<SelectionMarker
0 commit comments