Skip to main content

RouteVisualization

A map layer component for displaying planned routes with traffic conditions.

πŸ“‹ Overview​

PropertyValue
Filesrc/components/RouteVisualization.tsx
TypeReact Functional Component
AuthorUIP Team
Version1.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​

PropTypeRequiredDefaultDescription
routeRouteYes-Route to display
showTrafficbooleanNotrueColor by traffic
showIncidentsbooleanNotrueShow incidents
colorstringNo'#3388ff'Route color
alternativeRoutesRoute[]No[]Alt routes

🎨 Traffic Coloring​

SpeedColor
Free flow (>50 km/h)🟒 Green
Moderate (30-50 km/h)🟑 Yellow
Slow (15-30 km/h)🟠 Orange
Congested (<15 km/h)πŸ”΄ Red

See the complete components reference for all available components.