MapFragment

class MapFragment : Fragment, MapController, OnMapReadyCallback, KoinComponent

A Fragment for displaying a general-purpose map.

It provides a variety of controllers for UI, camera, markers, routes, location, and gestures, which are integrated with the map's lifecycle.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun addMarker(mapMarkerOptions: MapMarkerOptions)

Adds a marker to the map.

Link copied to clipboard
open override fun addRouteLine(mapRouteOptions: MapRouteOptions?)

Adds a new route line to the map.

Link copied to clipboard
open override fun changeMapStyle(styleUrl: String)
Link copied to clipboard
open override fun clearMap()

Removes all elements (routes, markers, etc.) displayed on the map.

Link copied to clipboard
open override fun initialize()

Initializes the basic UI elements of the map.

Link copied to clipboard
open override fun initializeLocation(activity: Any?)

Enables the location tracking feature.

Link copied to clipboard
open override fun removeAllMarkers()

Removes all markers displayed on the map.

Link copied to clipboard
open override fun removeAllRouteLines()

Removes all route lines displayed on the map.

Link copied to clipboard
open override fun removeMarker(markerId: String)

Removes a specific marker from the map.

Link copied to clipboard
open override fun setCompassButtonVisible(visible: Boolean)

Sets the visibility of the compass button.

Link copied to clipboard
open override fun setMapCenter(longitude: Double, latitude: Double, zoom: Double, tilt: Double, bearing: Double, animated: Boolean, durationMs: Int)

Sets the map's center coordinates and camera state.

Link copied to clipboard
open override fun setMapClickListener(listener: OnMapClickListener)

Sets a listener for map click events.

Link copied to clipboard
open override fun setMapLongClickListener(listener: OnMapLongClickListener)

Sets a listener for map long-click events.

Link copied to clipboard
open override fun setMapMoveListener(listener: OnMapMoveListener)

Sets a listener for map movement events.

Link copied to clipboard
open override fun setPadding(bottom: Int, top: Int, left: Int, right: Int)

Sets the map camera padding.

Link copied to clipboard
open override fun setTrackingMode(mode: MapTrackingMode)

Sets the map's tracking mode.

Link copied to clipboard
open override fun updateCarLocation(longitude: Double, latitude: Double, angle: Int)

Updates the current vehicle's location and bearing.

Link copied to clipboard
open override fun updateInstruction(instructions: List<MapRouteOptions.Instruction>)

Updates the guidance instructions (e.g., arrows) for a specific route.

Link copied to clipboard
open override fun updateRouteLine(progress: Double)

Updates the progress of a displayed route line.

Link copied to clipboard
open override fun zoomIn(durationMs: Int)

Zooms the map in by one level from its current state.

Link copied to clipboard
open override fun zoomOut(durationMs: Int)

Zooms the map out by one level from its current state.

Link copied to clipboard
open override fun zoomToFit(points: Array<MyPointD?>?, durationMs: Int, orbisPadding: Int)

Moves the camera to fit a given set of coordinates within the view.