You are using a browser that is no longer supported. Please use the latest version of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. For more information please see the System Requirements.
Skip To ContentArcGIS for DevelopersSign In Dashboard

Unsupported browser

You are using a browser that is not supported. JavaScript API works on the latest versions of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. Use one of these browsers and provide your feedback through GeoNet, the Esri Community.

  • {}
  • Firefox
  • Safari
  • undefined

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

Find and zoom to the user's current location using the Locate button widget. This widget uses the HTML5 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:

  • HTML5 Geolocation Position options for finding a location such as maximumAge and timeout.
  • The ability to define a custom graphic to highlight the user's location on the map.

There are security considerations to be taken into account when working with geolocation. The Locate widget is not supported on insecure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports Window.isSecureContext (currently Chrome and Firefox).

Sample search results