Display your current position on the map, as well as switch between different types of auto pan Modes.
When using a map within a GIS, it may be helpful for a user to know their own location within a map, whether that's to aid the user's navigation or to provide an easy means of identifying/collecting geospatial information at their location.
Tap the button in the lower right (which starts in Stop mode). A menu will appear with the following options:
- Stop - Stops the location display.
- On - Starts the location display with no
AutoPanMode
mode set. - Re-Center - Starts the location display with
AutoPanMode
set toRECENTER
. - Navigation - Starts the location display with
AutoPanMode
set toNAVIGATION
. - Compass - Starts the location display with
AutoPanMode
set toCOMPASS_NAVIGATION
.
- Create a
MapView
. - Get the
LocationDisplay
by calling.getLocationDisplay()
on theMapView
. - Use
startAsync()
andstop()
on theLocationDisplay
as necessary.
- ArcGISMap
- LocationDisplay
- MapView
Location permissions are required for this sample.
compass, GPS, location, map, mobile, navigation