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. The
bundleargument 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.
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.