MapProjectionDelegate

interface MapProjectionDelegate

Definition of a map projection delegate.

Functions

coordinateForProjectedMeters
Link copied to clipboard
abstract fun coordinateForProjectedMeters(projectedMeters: ProjectedMeters): Point

Calculate a longitude-latitude pair for a Spherical Mercator projected meters.

getMapProjection
Link copied to clipboard
abstract fun getMapProjection(): MapProjection

Get current map projection for the map. Should be used before initial style was loaded. When working with projections added during runtime styling please use Style's getProjection method.

getMetersPerPixelAtLatitude
Link copied to clipboard
abstract fun getMetersPerPixelAtLatitude(latitude: Double): Double

Calculate distance spanned by one pixel at the specified latitude at current zoom level.

abstract fun getMetersPerPixelAtLatitude(latitude: Double, zoom: Double): Double

Calculate distance spanned by one pixel at the specified latitude and zoom level.

project
Link copied to clipboard
abstract fun project(point: Point, zoomScale: Double): MercatorCoordinate

Calculate a point on the map in Mercator Projection for a given coordinate at the specified zoom scale.

projectedMetersForCoordinate
Link copied to clipboard
abstract fun projectedMetersForCoordinate(point: Point): ProjectedMeters

Calculate Spherical Mercator ProjectedMeters coordinates.

setMapProjection
Link copied to clipboard
abstract fun setMapProjection(mapProjection: MapProjection)

Set current map projection for the map. Should only be used to set projection before initial style was loaded to avoid visual blinking. When working with projections added during runtime styling please use Style's setProjection method.

unproject
Link copied to clipboard
abstract fun unproject(coordinate: MercatorCoordinate, zoomScale: Double): Point

Calculate a coordinate for a given point on the map in Mercator Projection.

Inheritors

MapboxMap
Link copied to clipboard