Interactive roads and numbers
Base Map with interactive roads and house numbers.
Hovering picks out the road under the cursor. Clicking holds it, dims what surrounds it and resolves an address at each end of the segment.
BaseMapModule.gethands over the style’s own roads, labels, shields and house numbers as one event surface, with no layer ids to track down.events.where({ layerGroups })splits that surface into the part worth exploring and the rest, each scope carrying its own hover cursor.- The handler receives the clicked geometry, so
reverseGeocodeturns its endpoints into street addresses.
Related examples
Interactive map labels
Click country, city and neighborhood labels on the map to show their boundaries
Getting Started
Base Map
Geometry
User Interaction Events
Web
Interactive Map POIs
Click on map POIs to see their details
Getting Started
Base Map
Places and POIs
User Interaction Events
Web
Mixed User Interaction Events
Handle various map events and user interactions
Getting Started
Base Map
User Interaction Events
Web
Pin on map with interaction
Click a pin to open its address, and click anywhere else on the map to close it
Getting Started
Places and POIs
Search and Geocoding
User Interaction Events
Web