Chuyển tới nội dung chính

MapLegend

A legend component explaining map symbols, colors, and layers.

📋 Overview

PropertyValue
Filesrc/components/MapLegend.tsx
TypeReact Functional Component
AuthorUIP Team
Version1.0.0

🎯 Purpose

  • Explain map symbols and colors
  • Show active layer legends
  • Provide scale information
  • Interactive layer toggling

🚀 Usage

import { MapLegend } from '@/components/MapLegend';

function MapComponent() {
return (
<MapContainer>
<MapLegend
layers={activeLayers}
position="bottomright"
/>
</MapContainer>
);
}

📦 Props

PropTypeRequiredDefaultDescription
layersLegendItem[]Yes-Legend items
positionMapPositionNo'bottomright'Legend position
collapsedbooleanNofalseCollapsed state
onLayerToggle(layer: string) => voidNo-Toggle handler

🎨 Legend Items

CategoryItems
CamerasActive, Offline, Maintenance
TrafficFree flow, Slow, Congested
IncidentsAccident, Hazard, Roadwork
WeatherRain, Fog, Clear

See the complete components reference for all available components.