@JsType(isNative=true) public abstract class CRS extends Object
Modifier and Type | Field and Description |
---|---|
String |
code
Standard code name of the CRS passed into WMS services (e.g.
|
Boolean |
infinite
If true, the coordinate space will be unbounded (infinite in both axes)
|
double[] |
wrapLat
Like wrapLng, but for the latitude (vertical) axis.
|
double[] |
wrapLng
An array of two numbers defining whether the longitude (horizontal) coordinate axis wraps around a given range and how.
|
Constructor and Description |
---|
CRS() |
Modifier and Type | Method and Description |
---|---|
double |
distance(LatLng latlng1,
LatLng latlng2)
Returns the distance between two geographical coordinates.
|
Bounds |
getProjectedBounds(double zoom)
Returns the projection's bounds scaled and transformed for the provided zoom.
|
Point |
latLngToPoint(LatLng latlng,
double zoom)
Projects geographical coordinates on a given zoom into pixel coordinates.
|
LatLng |
pointToLatLng(Point point,
double zoom)
The inverse of latLngToPoint.
|
Point |
project(LatLng latlng)
Projects geographical coordinates into coordinates in units accepted for this CRS (e.g.
|
double |
scale(double zoom)
Returns the scale used when transforming projected coordinates into pixel coordinates for a particular zoom.
|
LatLng |
unproject(Point point)
Given a projected coordinate returns the corresponding LatLng.
|
double |
wrapLatLng(LatLng latlng)
Returns a LatLng where lat and lng has been wrapped according to the CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.
|
double |
zoom(double scale)
Inverse of scale(), returns the zoom level corresponding to a scale factor of scale.
|
@JsProperty public String code
@JsProperty public double[] wrapLng
@JsProperty public double[] wrapLat
@JsProperty public Boolean infinite
@JsMethod public Point latLngToPoint(LatLng latlng, double zoom)
latlng
- the latlngzoom
- the zoom@JsMethod public LatLng pointToLatLng(Point point, double zoom)
point
- the pointzoom
- the zoom@JsMethod public Point project(LatLng latlng)
latlng
- the latlng@JsMethod public LatLng unproject(Point point)
point
- the point@JsMethod public double scale(double zoom)
zoom
- the zoom@JsMethod public double zoom(double scale)
scale
- the scale@JsMethod public Bounds getProjectedBounds(double zoom)
zoom
- the zoom level@JsMethod public double distance(LatLng latlng1, LatLng latlng2)
latlng1
- latlng2
- @JsMethod public double wrapLatLng(LatLng latlng)
latlng
- Copyright © 2018 G-Widgets. All rights reserved.