Show a geocoded location

Geocode a place name, open the map framed on its extent and pin it

View on GitHub
SDK 1.0.0-rc.7

A place name goes in, and the map opens framed on the whole city with a pin on its centre.

  • geocodeOne returns one GeoJSON feature rather than a result list, so there is no best match to pick.
  • Its bbox goes straight into the map’s bounds option, so the opening view fits a street or a region with no zoom worked out by hand.
  • PlacesModule.show draws the pin and its label from that same feature, with no source or layer to register.

Related examples