MapFragment

An Android fragment wrapping the TomTom MapView. This fragment handles a complete lifecycle of the underlying MapView. It can be instantiated either programmatically via MapFragment.newInstance(mapOptions: MapOptions) or via the XML view inflation. See MapResources to check what attributes can be configured via XML.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val balloonsViewContainer: ViewGroup

This represents the container view for any balloon markers on the map. When clicked, balloon markers typically show more information about a specific point on the map.

Link copied to clipboard
open override val compassButton: CompassButton

This represents the compass button on the map. This button provides a quick way for users to change the map to have a northern orientation.

Link copied to clipboard

This represents the button that shows the user's current location on the map.

Link copied to clipboard
open override val logoView: LogoView

This represents the logo of the map provider. This logo ensures the correct attribution is given to the map data source.

Link copied to clipboard

This represents the adapter for the balloon views. The adapter determines how the content inside each balloon marker is displayed.

Link copied to clipboard
open override val scaleView: ScaleView

This represents the scale view on the map. This shows the scale of the map in relation to the real world distances.

Link copied to clipboard

This represents the zoom controls on the map. These controls allow users to zoom in and out of the map view.

Inherited properties

Link copied to clipboard
@get:NonNull
open override val lifecycle: Lifecycle
Link copied to clipboard
Link copied to clipboard
@get:NonNull
open override val viewModelStore: ViewModelStore

Functions

Link copied to clipboard
open override fun getMapAsync(callback: MapReadyCallback): Cancellable

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.

Link copied to clipboard
open override fun onCreate(savedInstanceState: Bundle?)

Handles the 'onCreate' lifecycle event. Initializes the MapView internals and UI components.

Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, state: Bundle?): View

Called on the fragment to instantiate its MapView. If there were some calls for getMapAsync(callback: OnMapReadyCallback), then the subscribed callbacks will be executed as soon as the MapView is created and the underlying TomTomMap is available.

Link copied to clipboard
open override fun onDestroy()

This handles the 'onDestroy' lifecycle event. It is called when the parent component is being destroyed. This ensures the internal map view components are properly shut down and resources are freed.

Link copied to clipboard
open override fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle?)

This is called when the fragment's UI is created. This method parses the given attributes and sets the map options accordingly.

Link copied to clipboard
open override fun onPause()

This handles the 'onPause' lifecycle event. It is called when the parent component is no longer resumed but still visible. This ensures the internal map view components pause their active processes to conserve resources.

Link copied to clipboard
open override fun onResume()

This handles the 'onResume' lifecycle event. It is called when the parent component is visible to the user and actively running. This ensures the internal map view components are active and updated.

Link copied to clipboard
open override fun onSaveInstanceState(outState: Bundle)

This handles the 'onSaveInstanceState' lifecycle event. It is called when the parent component saves its instance state. This 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.

Link copied to clipboard
open override fun onStart()

This handles the 'onStart' lifecycle event. It is called when the parent component becomes visible to the user. This ensures the internal map view components are ready to display.

Link copied to clipboard
open override fun onStop()

This handles the 'onStop' lifecycle event. It is called when the parent component is no longer visible to the user. This ensures the internal map view components stop all active processes to conserve resources.

Inherited functions

Link copied to clipboard
Link copied to clipboard
operator override fun equals(@Nullable other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getId(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getView(): View?
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onLowMemory()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setArguments(@Nullable p0: Bundle?)
Link copied to clipboard
Link copied to clipboard
open fun setExitTransition(@Nullable p0: Any?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun startActivity(p0: Intent)
open fun startActivity(p0: Intent, @Nullable p1: Bundle?)
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard