summaryrefslogtreecommitdiff
path: root/src/Map.tsx
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2022-08-30 09:13:37 +0300
committerYuval Adam <_@yuv.al>2022-08-30 09:13:37 +0300
commitc5af7e2ee2fd84badb60cf2bab8b9fc341e9bdad (patch)
treeb6f17016883d478235a854a4e1b8a864a45f1d1e /src/Map.tsx
parentfd9ea96df63c8369d7e1832a333a63671248de6c (diff)
WIP
Diffstat (limited to 'src/Map.tsx')
-rw-r--r--src/Map.tsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Map.tsx b/src/Map.tsx
index 032b6dd..62bebb2 100644
--- a/src/Map.tsx
+++ b/src/Map.tsx
@@ -22,6 +22,8 @@ function Map({ slider, images }: MapProps) {
const [lat, setLat] = useState(31.9);
const [zoom, setZoom] = useState(6.3);
+ const prevImages = useRef({ images }).current;
+
useEffect(() => {
if (map.current) return; // initialize map only once
map.current = new mapboxgl.Map({
@@ -45,6 +47,11 @@ function Map({ slider, images }: MapProps) {
});
});
+ useEffect(() => {
+ // handle layer updates
+ console.log(images)
+ }, [images]);
+
return (
<div>
<div ref={mapContainer} className="map-container" style={{