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 of 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
Sets a callback that will be triggered when the map instance is ready to use. The callback will be executed on the main thread. Note: You must call this method from the main thread. Otherwise an exception will be thrown.
Callback which should be called when the parent lifecycle aware component saves its instance state. Note the bundle
which must be handled explicitly during saving.
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.