MapView
MapView to wrap the underlying map renderer. It handles application lifecycle events in order to properly manage the lifecycle of the map. The view can be created programmatically or via the XML view inflation. See MapResources to check what attributes can be configured via XML.
Direct usage of this class must ensure binding between the following lifecycle methods:
onCreate(bundle: Bundle?)
- called when the parent, lifecycle aware component is being created. Thebundle
argument contains extra data which shall be handled by calling the corresponding onSaveInstanceState(bundle: Bundle) callback.onStart()
- called when the parent component is visible to the user.onResume()
- called when the parent component is visible to the user and actively running.onPause()
- called when the parent component is no longer resumed.onStop()
- called when the parent component is no longer started.onSaveInstanceState(bundle: Bundle)
- called when the parent component saves its instance state. See the onSaveInstanceState(bundle: Bundle) for a sample usage of this callback.onDestroy()
- called when the parent component is being destroyed.
Constructors
Functions
Fetches a map instance asynchronously. The provided callback is invoked when the map instance is ready for use.
This handles the 'onSaveInstanceState' lifecycle event. It is called when the parent component saves its instance state. Stores the current state of the MapView component, ensuring that the state can be restored after a configuration change or other events that restart the component.
Overridden in order to support internal map gestures. Usually the parent component does not have to call this method manually as it is called by the Android Framework.
Properties
This provides access to the container view that holds all balloon views associated with markers on the map.
This provides access to the compass button UI component on the MapView. This button adjusts the map to a northern orientation.
This provides access to the current location button UI component on the MapView. This button can be used to move the map's focus to the user's current location.
This gets or sets the adapter responsible for providing and managing balloon views associated with markers on the map.
This provides access to the zoom controls UI component on the MapView. These controls can be used to zoom in and out on the map.