MapController

interface MapController

Controls general map properties. It also provides two helper methods which can do a conversion between a Point on the screen and its GeoCoordinate counterpart.

Important: This is a Public Preview API. It may be changed or removed at any time.

Functions

Link copied to clipboard
abstract fun coordinateForPoint(point: Point): Result<GeoCoordinate, InvalidPointException>

Converts a Point on the MapView to a position on the map. Returns Result with GeoCoordinate or InvalidPointException when cannot obtain a coordinate from the given point. It can occur when the point is not on the map.

Link copied to clipboard
abstract fun pointForCoordinate(coordinate: GeoCoordinate): Point

Converts a position on the map into the MapView point.

Link copied to clipboard
abstract fun setFrameRate(frameRate: Int)

Applies a frame rate cap on the map renderer. It can be useful for scenarios where the map is not fully visible to the user hence there is no need to render it with its full performance.

Link copied to clipboard
abstract fun setLanguage(language: String)

Sets map language as IETF language tag.

Link copied to clipboard
abstract fun setPadding(padding: Padding)

Sets padding on the map. For the map, the padding means a safe area of the MapView which does not receive any input from the user. The safe area can be useful for some sections of the user interface displaying UI components like buttons, sliders etc.

Properties

Link copied to clipboard
abstract val visibleRegion: Result<VisibleRegion, InvalidRegionException>

Provides the Result that contains VisibleRegion or InvalidRegionException, where VisibleRegion is currently visible region. If the map is completely zoomed out, this property will return four GeoCoordinates, which are combination of min/max latitude and longitude ranges. InvalidRegionException is returned if some of four coordinates is invalid and it is not possible to obtain a coordinate.

Inheritors

Link copied to clipboard