Back to all examples
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
Everything the conversation draws on the map also lands in a side panel, where an entry can be shown again, hidden or dropped.
createMapAgentputs this map and the TomTom services behind the chat, with the tools and system prompt included.agent.statekeeps one typed slice per kind of result (places, routes, incidents, loaded GeoJSON), each emittingshown-changeandmode-changefor the React panels to bind to.showEntry,hideEntryandsetEntryModeput a panel button on the path the agent’s own tools take, so the panel and the model never disagree.
Related examples
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
Site Selection Agent
A site selection agent on the TomTom Maps SDK Agent Toolkit: hand-picked default tools, custom analysis tools, its own persona and state slice
Playground
AI
Search and Geocoding
Places and POIs
Routing
Traffic
Map Style
Base Map
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
Reachable ranges playground
Style drive-time bands from two stations, and theme the map they take their colours from
Playground
Routing
Geometry
Map Style
Plugins
Web