update frontend

This commit is contained in:
Your Name 2025-12-21 21:59:31 -05:00
parent 5b3d35cd25
commit 48edeb03fe
2 changed files with 17 additions and 23 deletions

View File

@ -4,14 +4,14 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- PWA + Favicon --> <!-- Favicon -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/icons/apple-touch-icon.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/icons/apple-touch-icon.png" />
<meta name="theme-color" content="#0ea5e9" />
<!-- Description + Open Graph (Facebook/Twitter/WhatsApp) --> <!-- PWA Manifest -->
<meta name="description" content="SocioWire - Wired to life. Local news, events, market deals & friends on map." /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!-- Meta pour partage (logo + titre + description) -->
<meta property="og:title" content="SocioWire.com - Wired to life" /> <meta property="og:title" content="SocioWire.com - Wired to life" />
<meta property="og:description" content="Local news, events, market deals & friends on the map." /> <meta property="og:description" content="Local news, events, market deals & friends on the map." />
<meta property="og:image" content="%PUBLIC_URL%/icons/og-image.png" /> <meta property="og:image" content="%PUBLIC_URL%/icons/og-image.png" />
@ -24,11 +24,11 @@
<meta name="twitter:description" content="Local news, events, market deals & friends on the map." /> <meta name="twitter:description" content="Local news, events, market deals & friends on the map." />
<meta name="twitter:image" content="%PUBLIC_URL%/icons/og-image.png" /> <meta name="twitter:image" content="%PUBLIC_URL%/icons/og-image.png" />
<!-- Titre --> <!-- Titre de la page -->
<title>SocioWire.com - Wired to life</title> <title>SocioWire.com - Wired to life</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script type="module" src="/src/main.jsx"></script> // <script type="module" src="/src/main.jsx"></script>
</body> </body>
</html> </html>

View File

@ -49,20 +49,14 @@ export function useMapCore(theme) {
const el = expandedElRef.current; const el = expandedElRef.current;
if (!el) return; if (!el) return;
// overlay style
if (el.__swClose) { if (el.__swClose) {
try { try { el.__swClose(); } catch {}
el.__swClose();
} catch {}
expandedElRef.current = null; expandedElRef.current = null;
return; return;
} }
// legacy marker-expanded style
if (el.__renderCompact) { if (el.__renderCompact) {
try { try { el.__renderCompact(); } catch {}
el.__renderCompact();
} catch {}
} }
expandedElRef.current = null; expandedElRef.current = null;
} }
@ -75,7 +69,7 @@ export function useMapCore(theme) {
style: getBaseStyle(theme || "dark"), style: getBaseStyle(theme || "dark"),
center: [-95, 40], center: [-95, 40],
zoom: 3.5, zoom: 3.5,
pitch: 0, pitch: 45, // ACTIVATION DU TILT 3D PAR DÉFAUT (globe incliné)
bearing: 0, bearing: 0,
antialias: true, antialias: true,
}); });
@ -88,16 +82,16 @@ export function useMapCore(theme) {
if (typeof v.lat === "number" && typeof v.lon === "number" && typeof v.zoom === "number") { if (typeof v.lat === "number" && typeof v.lon === "number" && typeof v.zoom === "number") {
map.setCenter([v.lon, v.lat]); map.setCenter([v.lon, v.lat]);
map.setZoom(v.zoom); map.setZoom(v.zoom);
map.setPitch(45); // tilt 3D forcé
hadLastView = true; hadLastView = true;
} }
} }
} catch {} } catch {}
setHasLastView(hadLastView); setHasLastView(hadLastView);
map.addControl(new maplibregl.NavigationControl(), "top-right"); map.addControl(new maplibregl.NavigationControl({ showCompass: true, showZoom: true }), "top-right");
mapRef.current = map; mapRef.current = map;
// ✅ Ensure viewParams is set immediately so posts load without moving the map
try { setViewParams(getViewFromMap(map)); } catch {} try { setViewParams(getViewFromMap(map)); } catch {}
const reOcclude = () => { const reOcclude = () => {
@ -107,12 +101,13 @@ export function useMapCore(theme) {
map.on("move", reOcclude); map.on("move", reOcclude);
map.on("zoom", reOcclude); map.on("zoom", reOcclude);
// ignore close while auto actions are happening
map.on("click", () => { closeExpandedIfAny(); }); map.on("click", () => { closeExpandedIfAny(); });
map.on("dragstart", () => { 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", () => { map.on("moveend", () => {
const vp = getViewFromMap(map); const vp = getViewFromMap(map);
@ -131,7 +126,6 @@ export function useMapCore(theme) {
map.remove(); map.remove();
mapRef.current = null; mapRef.current = null;
}; };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
useEffect(() => { useEffect(() => {
@ -141,4 +135,4 @@ export function useMapCore(theme) {
}, [theme]); }, [theme]);
return { containerRef, mapRef, markersRef, expandedElRef, viewParams, hasLastView }; return { containerRef, mapRef, markersRef, expandedElRef, viewParams, hasLastView };
} }