CRS

abstract external class CRS

Coordinate Reference System

Object that defines coordinate reference systems for projecting geographical points into pixel (screen) coordinates and back (and to coordinates in other units for WMS services).

Leaflet defines the most usual CRSs by default. If you want to use a CRS not defined by default, take a look at the Proj4Leaflet plugin.

Note that the CRS instances do not inherit from Leaflet's Class object, and can't be instantiated. Also, new classes can't inherit from them, and methods can't be added to them with the include function.

See: https://leafletjs.com/reference.html#crs-l-crs-base

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var code: String?

Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857')

Link copied to clipboard

If true, the coordinate space will be unbounded (infinite in both axes)

Link copied to clipboard
var wrapLat: <Error class: unknown class><Number, Number>?

Like wrapLng, but for the latitude (vertical) axis.

Link copied to clipboard
var wrapLng: <Error class: unknown class><Number, Number>?

A pair of two numbers defining whether the longitude (horizontal) coordinate axis wraps around a given range and how. Defaults to [-180, 180] in most geographical CRSs.

Functions

Link copied to clipboard
fun distance(latlng1: LatLng, latlng2: LatLng): Number
Link copied to clipboard
Link copied to clipboard
fun latLngToPoint(latlng: LatLng, zoom: Number): Point
Link copied to clipboard
fun pointToLatLng(point: Point, zoom: Number): LatLng
Link copied to clipboard
fun project(latlng: LatLng): Point
Link copied to clipboard
fun scale(zoom: Number): Number
Link copied to clipboard
fun unproject(point: Point): LatLng
Link copied to clipboard
fun wrapLatLng(latlng: LatLng): LatLng
Link copied to clipboard
fun zoom(scale: Number): Number