RouteVisualization
A map layer component for displaying planned routes with traffic conditions.
π Overviewβ
| Property | Value |
|---|---|
| File | src/components/RouteVisualization.tsx |
| Type | React Functional Component |
| Author | UIP Team |
| Version | 1.0.0 |
π― Purposeβ
- Render route polylines on map
- Show traffic conditions along route
- Highlight incidents on route
- Display turn-by-turn points
π Usageβ
import { RouteVisualization } from '@/components/RouteVisualization';
function MapComponent() {
return (
<MapContainer>
<RouteVisualization
route={selectedRoute}
showTraffic={true}
showIncidents={true}
/>
</MapContainer>
);
}
π¦ Propsβ
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
route | Route | Yes | - | Route to display |
showTraffic | boolean | No | true | Color by traffic |
showIncidents | boolean | No | true | Show incidents |
color | string | No | '#3388ff' | Route color |
alternativeRoutes | Route[] | No | [] | Alt routes |
π¨ Traffic Coloringβ
| Speed | Color |
|---|---|
| Free flow (>50 km/h) | π’ Green |
| Moderate (30-50 km/h) | π‘ Yellow |
| Slow (15-30 km/h) | π Orange |
| Congested (<15 km/h) | π΄ Red |
π Related Componentsβ
- RoutePlanner - Route planning
- SpeedZones - Speed visualization
- TrafficMap - Map container
See the complete components reference for all available components.