fix(geoportal): fullscreen route + local CSS + proper layout
- Add /geoportal to FULLSCREEN_ROUTES (overflow-hidden, no padding) - Copy maplibre-gl.css to public/ and load from same origin (avoids CDN/CSP) - Simplify layout: fill parent via h-full w-full (no negative margin hack) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -93,8 +93,7 @@ export function GeoportalModule() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative -mx-4 -mt-4 sm:-mx-6 sm:-mt-6 lg:-mx-8 lg:-mt-8"
|
<div className="relative h-full w-full">
|
||||||
style={{ height: "calc(100vh - 3.5rem)" }}>
|
|
||||||
{/* Full-bleed map */}
|
{/* Full-bleed map */}
|
||||||
<MapViewer
|
<MapViewer
|
||||||
ref={mapHandleRef}
|
ref={mapHandleRef}
|
||||||
|
|||||||
@@ -4,14 +4,15 @@ import { useRef, useEffect, useState, useCallback, useImperativeHandle, forwardR
|
|||||||
import maplibregl from "maplibre-gl";
|
import maplibregl from "maplibre-gl";
|
||||||
import { cn } from "@/shared/lib/utils";
|
import { cn } from "@/shared/lib/utils";
|
||||||
|
|
||||||
/* Ensure MapLibre CSS is loaded — static import fails with next/dynamic + standalone */
|
/* Ensure MapLibre CSS is loaded — static import fails with next/dynamic + standalone.
|
||||||
|
Load from /public to avoid CDN/CSP issues. */
|
||||||
if (typeof document !== "undefined") {
|
if (typeof document !== "undefined") {
|
||||||
const LINK_ID = "maplibre-gl-css";
|
const LINK_ID = "maplibre-gl-css";
|
||||||
if (!document.getElementById(LINK_ID)) {
|
if (!document.getElementById(LINK_ID)) {
|
||||||
const link = document.createElement("link");
|
const link = document.createElement("link");
|
||||||
link.id = LINK_ID;
|
link.id = LINK_ID;
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.href = "https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css";
|
link.href = "/maplibre-gl.css";
|
||||||
document.head.appendChild(link);
|
document.head.appendChild(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { cn } from '@/shared/lib/utils';
|
|||||||
const SIDEBAR_COLLAPSED_KEY = 'sidebar:collapsed';
|
const SIDEBAR_COLLAPSED_KEY = 'sidebar:collapsed';
|
||||||
|
|
||||||
// Routes that need full viewport height and no padding (canvas tools)
|
// Routes that need full viewport height and no padding (canvas tools)
|
||||||
const FULLSCREEN_ROUTES = ['/visual-copilot'];
|
const FULLSCREEN_ROUTES = ['/visual-copilot', '/geoportal'];
|
||||||
|
|
||||||
interface AppShellProps {
|
interface AppShellProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user