From 48edeb03fe92f26795c19a1d94edad92d3cb520b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 21 Dec 2025 21:59:31 -0500 Subject: [PATCH] update frontend --- index.html | 14 +++++++------- src/components/Map/useMapCore.js | 26 ++++++++++---------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/index.html b/index.html index 46322d2..8a22578 100644 --- a/index.html +++ b/index.html @@ -4,14 +4,14 @@ - - + - - - + + + + @@ -24,11 +24,11 @@ - + SocioWire.com - Wired to life
- +// \ No newline at end of file diff --git a/src/components/Map/useMapCore.js b/src/components/Map/useMapCore.js index ba2ebad..6b70589 100644 --- a/src/components/Map/useMapCore.js +++ b/src/components/Map/useMapCore.js @@ -49,20 +49,14 @@ export function useMapCore(theme) { const el = expandedElRef.current; if (!el) return; - // overlay style if (el.__swClose) { - try { - el.__swClose(); - } catch {} + try { el.__swClose(); } catch {} expandedElRef.current = null; return; } - // legacy marker-expanded style if (el.__renderCompact) { - try { - el.__renderCompact(); - } catch {} + try { el.__renderCompact(); } catch {} } expandedElRef.current = null; } @@ -75,7 +69,7 @@ export function useMapCore(theme) { style: getBaseStyle(theme || "dark"), center: [-95, 40], zoom: 3.5, - pitch: 0, + pitch: 45, // ACTIVATION DU TILT 3D PAR DÉFAUT (globe incliné) bearing: 0, antialias: true, }); @@ -88,16 +82,16 @@ export function useMapCore(theme) { if (typeof v.lat === "number" && typeof v.lon === "number" && typeof v.zoom === "number") { map.setCenter([v.lon, v.lat]); map.setZoom(v.zoom); + map.setPitch(45); // tilt 3D forcé hadLastView = true; } } } catch {} setHasLastView(hadLastView); - map.addControl(new maplibregl.NavigationControl(), "top-right"); + map.addControl(new maplibregl.NavigationControl({ showCompass: true, showZoom: true }), "top-right"); mapRef.current = map; - // ✅ Ensure viewParams is set immediately so posts load without moving the map try { setViewParams(getViewFromMap(map)); } catch {} const reOcclude = () => { @@ -107,12 +101,13 @@ export function useMapCore(theme) { map.on("move", reOcclude); map.on("zoom", reOcclude); - // ignore close while auto actions are happening map.on("click", () => { closeExpandedIfAny(); }); - map.on("dragstart", () => { closeExpandedIfAny(); }); - map.on("load", () => setViewParams(getViewFromMap(map))); + map.on("load", () => { + setViewParams(getViewFromMap(map)); + map.setPitch(45); // tilt 3D forcé au load + }); map.on("moveend", () => { const vp = getViewFromMap(map); @@ -131,7 +126,6 @@ export function useMapCore(theme) { map.remove(); mapRef.current = null; }; - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { @@ -141,4 +135,4 @@ export function useMapCore(theme) { }, [theme]); return { containerRef, mapRef, markersRef, expandedElRef, viewParams, hasLastView }; -} +} \ No newline at end of file