Find and zoom to the user's current location using the Locate button widget. This widget uses the browser's Geolocation API to find the user's current location. Once the location is found, the view animates to that location, and the view rotates according to the direction where the tracked device is heading towards. The widget provides options that allow the developer to define the following:
geolocation
for finding a location such asOptions maximum
,Age timeout
andenable
.High Accuracy - The ability to define a custom graphic to highlight the user's location on the map.
The Locate component will only work in secure contexts. To use it, switch your application to a secure URL, such as https
. Note that http
is considered to be trustworthy, and can be used for testing.