fix(geoportal): load MapLibre CSS via CDN link injection + fullscreen layout
- Static CSS import doesn't work with next/dynamic + standalone output. Now injects a <link> tag to unpkg CDN at module load time (bulletproof). - Geoportal is now fullscreen: map fills entire viewport below the header, no duplicate title/description, negative margins bleed to edges. - Removed page-level CSS imports (no longer needed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,19 @@
|
||||
|
||||
import { useRef, useEffect, useState, useCallback, useImperativeHandle, forwardRef } from "react";
|
||||
import maplibregl from "maplibre-gl";
|
||||
import "maplibre-gl/dist/maplibre-gl.css";
|
||||
import { cn } from "@/shared/lib/utils";
|
||||
|
||||
/* Ensure MapLibre CSS is loaded — static import fails with next/dynamic + standalone */
|
||||
if (typeof document !== "undefined") {
|
||||
const LINK_ID = "maplibre-gl-css";
|
||||
if (!document.getElementById(LINK_ID)) {
|
||||
const link = document.createElement("link");
|
||||
link.id = LINK_ID;
|
||||
link.rel = "stylesheet";
|
||||
link.href = "https://unpkg.com/maplibre-gl@5.21.0/dist/maplibre-gl.css";
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
}
|
||||
import type { BasemapId, ClickedFeature, LayerVisibility, SelectedFeature } from "../types";
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
Reference in New Issue
Block a user