Usage
Examples
Basic Places Widget
With Default Position
With Places Options
Options
The Algolia Places reference to use. This should be the
places function imported from the places.js library.See the Algolia Places documentation for more details.The default position when the input is empty. Expects an array with latitude and longitude as strings.
CSS Selector or HTMLElement for the Places autocomplete input. This is passed to the Places.js library.
Restricts the search to a specific type of location. Possible values:
'city''country''address''busStop''trainStation''townhall''airport'
Restricts the search to specific countries. Expects an array of ISO 3166-1 alpha-2 country codes.
The language to use for the Places autocomplete. Uses ISO 639-1 language codes.
Whether to bias results around the user’s location based on their IP address.
Force the search to be biased around a specific location. Format:
"lat,lng"Behavior
When a user selects a location from the Places autocomplete:- The widget sets the
aroundLatLngsearch parameter to the selected location’s coordinates - It disables
aroundLatLngViaIPto use the exact location - It triggers a new search with the location-based filtering
- If a
defaultPositionis set, the search uses those coordinates - Otherwise, it reverts to the initial
aroundLatLngViaIPsetting
Migration
Since Algolia Places is deprecated, consider using alternative location search services or implementing a custom solution using the
configure widget to set geolocation parameters.