AccidentMarkers
Map markers component for displaying accident locations with severity indicators.
π Overviewβ
| Property | Value |
|---|---|
| File | src/components/AccidentMarkers.tsx |
| Type | React Functional Component |
| Author | UIP Team |
| Version | 1.0.0 |
π― Purposeβ
- Display accident locations on the map
- Color-coded severity indicators (critical, high, medium, low)
- Clickable markers with popup details
- Real-time updates for new accidents
π Usageβ
import { AccidentMarkers } from '@/components/AccidentMarkers';
function MapComponent() {
return (
<MapContainer>
<AccidentMarkers
accidents={accidentList}
onMarkerClick={handleAccidentClick}
/>
</MapContainer>
);
}
π¦ Propsβ
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
accidents | Accident[] | Yes | - | List of accidents |
onMarkerClick | (accident: Accident) => void | No | - | Click handler |
showPopup | boolean | No | true | Show popup on click |
filterSeverity | string[] | No | [] | Filter by severity |
π¨ Severity Colorsβ
| Severity | Color | Icon |
|---|---|---|
| Critical | π΄ Red | AlertCircle |
| High | π Orange | AlertTriangle |
| Medium | π‘ Yellow | Alert |
| Low | π’ Green | Info |
π Related Componentsβ
- TrafficMap - Parent map component
- CitizenReportMarkers - Report markers
See the complete components reference for all available components.