Locate button

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:

  • geolocationOptions for finding a location such as maximumAge, timeout and enableHighAccuracy.
  • 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://localhost is considered to be trustworthy, and can be used for testing.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close