arcgis-maps-sdk-swift-toolkit
arcgis-maps-sdk-swift-toolkit copied to clipboard
Location Button
trafficstars
Adds a button to the toolkit that allows a user to show their current location.
The view can be positioned anywhere, with any background. This example uses a "regular material background" in a rounded rectangle.
- Tap once, location display starts, if using a system location datasource, it will request authorization, while starting a progress indicator is shown
- Starts in auto pan mode recenter
- Long press to get a context menu
- Switch to navigation mode, any autopan mode, or turn the datasource off
- If the location display fails to start, an warning signal is shown, tapping again will try to start the datasource again
- Panning turns autopan off, tapping the button again will turn on the last autopan mode that the user had selected (barring the
offvalue)
More details
- The context menu is only shown on long press if the count of the auto pan options the user passes in is greater than 1
- The "last selected auto pan mode" starts out with a default value of the first value passed to the initializer in the
autoPanOptionsthat matches a value in this list:.recenter, .compassNavigation, .navigation