Class MercatorCoordinate
Implements
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
- x: number
The x component of the position.
- y: number
The y component of the position.
Optionalz: numberThe z component of the position.
Returns MercatorCoordinate
- x: number
Methods
meterInMercatorCoordinateUnits
Returns the distance of 1 meter in
MercatorCoordinateunits at this latitude.For coordinates in real world units using meters, this naturally provides the scale to transform into
MercatorCoordinates.Returns number
Distance of 1 meter in
MercatorCoordinateunits.
toAltitude
toLngLat
StaticfromLngLat
Project a
LngLatto aMercatorCoordinate.Parameters
- lngLatLike: LngLatLike
The location to project.
Optionalaltitude: numberThe altitude in meters of the position.
Returns MercatorCoordinate
The projected mercator coordinate.
- lngLatLike: LngLatLike
Was this helpful?
A
MercatorCoordinateobject represents a projected three dimensional position.MercatorCoordinateuses the web mercator projection (EPSG:3857) with slightly different units:For example,
MercatorCoordinate(0, 0, 0)is the north-west corner of the mercator world andMercatorCoordinate(1, 1, 0)is the south-east corner. If you are familiar with vector tiles it may be helpful to think of the coordinate space as the0/0/0tile with an extent of1.The
zdimension ofMercatorCoordinateis conformal. A cube in the mercator coordinate space would be rendered as a cube.Example
See