From c5af7e2ee2fd84badb60cf2bab8b9fc341e9bdad Mon Sep 17 00:00:00 2001
From: Yuval Adam <_@yuv.al>
Date: Tue, 30 Aug 2022 09:13:37 +0300
Subject: WIP

---
 src/Map.tsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/Map.tsx')

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={{
-- 
cgit v1.3.1

