Traffic incident details
Search a city and render its current traffic incidents, clipped to its boundary, as a developer-controlled overlay
Search a city and its current traffic incidents are drawn inside its dashed boundary. Click one to focus it while the rest fade back, and the panel restyles the focus.
trafficIncidentDetailstakes the boundarygeometryDatareturns as itspolygon, so incidents in the corners of the city’s bounding box are dropped.TrafficIncidentDetailsModule.showtakes that response as it arrives, andsetFocussingles out the clicked incident by id.highlight.unfocusedOpacityFactorfades every other incident, icons included, until a click on the map clears the focus.trafficIncidentDetailsKnobCataloguelists each setting’s kind, range and default, so the panel is generated, andsetKnobsets one by its id, repainting the focused incident in place.
Related examples
Delivery zones of your own
Show your own GeoJSON polygons and respond to clicks on them
Customization
Bring Your Own Data
Geometry
User Interaction Events
Web
Map Chat Agent
Ask a chat beside the map for places, routes or traffic, and watch the map search, draw and frame the answer
Playground
AI
Search and Geocoding
Places and POIs
Map Style
Base Map
Geometry
Traffic
Routing
Plugins
Web
React
Map Chat Agent State Playground
A map chat whose every result lands in a side panel, where you can show, hide or drop it yourself
Playground
AI
Search and Geocoding
Places and POIs
Map Style
Base Map
Geometry
Traffic
Routing
Bring Your Own Data
Plugins
Web
React
Live Traffic Agent
AI traffic-manager assistant: monitor incidents, cluster hotspots, and analyse network state
Playground
AI
Search and Geocoding
Map Style
Base Map
Geometry
Traffic
Routing
Plugins
Web
React