import { Check, Eye, EyeOff, Lock, Map } from "lucide-react"; import { cn } from "@/lib/utils"; import type { BaseLayerOption } from "./base-layers-control"; import type { MapLayerControlItem } from "./layer-control"; import { MAP_COMPACT_RADIUS_CLASS_NAME, MAP_ICON_CELL_RADIUS_CLASS_NAME, MAP_READABLE_RADIUS_CLASS_NAME, MAP_READABLE_SURFACE_CLASS_NAME, MAP_READABLE_SURFACE_STRONG_CLASS_NAME } from "./map-control-styles"; export type MapLayerPanelProps = { layerItems: MapLayerControlItem[]; baseLayerOptions: BaseLayerOption[]; activeBaseLayerId: string; onSelectBaseLayer: (id: string) => void; onToggleLayer: (id: string, visible: boolean) => void; }; export function MapLayerPanel({ layerItems, baseLayerOptions, activeBaseLayerId, onSelectBaseLayer, onToggleLayer }: MapLayerPanelProps) { return ( <> ); } type LayerVisibilitySectionProps = { items: MapLayerControlItem[]; onToggleLayer: (id: string, visible: boolean) => void; }; function LayerVisibilitySection({ items, onToggleLayer }: LayerVisibilitySectionProps) { return (
业务图层
{items.map((item) => { const Icon = item.visible ? Eye : EyeOff; const disabled = item.disabled || item.locked; return ( ); })}
); } type BaseLayerSectionProps = { options: BaseLayerOption[]; activeLayerId: string; onSelectLayer: (id: string) => void; }; function BaseLayerSection({ options, activeLayerId, onSelectLayer }: BaseLayerSectionProps) { return (
底图
{options.map((option) => { const active = option.id === activeLayerId; return ( ); })}
); } type BaseLayerSwatchProps = { option: BaseLayerOption; active: boolean; }; function BaseLayerSwatch({ option, active }: BaseLayerSwatchProps) { return ( {active ? ( ) : null} ); }