Class: CRS

CRS

Proj coordinate system definition class. For computing level, options.scales options.scaleDenominators options.resolutions options.bounds One must be specified and the order is prioritized. When options.bounds is specified,the Level 0 is a 256 tile containing the entire bounds,which is Math.max(bounds.getSize().x, bounds.getSize().y)/256 。 To ensure that the tile rank is correct,options.origin options.bounds must be specified one. When options.bounds is specified,the tile origin is the upper left corner of bounds.

L.Proj.CRS(srsCode, options)

Proj4Leaflet.js, line 85
Name Type Description
srsCode string

proj srsCode。

options Object

options.

Name Type Default Description
def string

The Proj4 definition of projection. detailed

origin Array.<number> | L.Point optional

The origin.

scales Array.<number> optional

The scale array.

scaleDenominators Array.<number> optional

The scale denominator array.

resolutions Array.<number> optional

The resolutions array.

bounds Array.<number> | L.Bounds optional

The bounds.

dpi number 96 optional

dpi。

Example
var crs =L.Proj.CRS("EPSG:4326",{
    origin: [-180,90],
    scaleDenominators: [2000,1000,500,200,100,50,20,10],
});
var map=L.map('map', {
    crs: crs
    ...
})

Extends

Methods

scale(zoom)

Proj4Leaflet.js, line 192

Get the scale value according to the zoom level.

Name Type Description
zoom number

The zoom level.

Returns:
The scale.

zoom(scale){number}

Proj4Leaflet.js, line 216

Get the zoom level according to the scale value.

Name Type Description
scale number

The scale value.

Returns:
Type Description
number The zoom level.