The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. Thisprojection use longitude and latitude expressed with the WGS84 and transforms them to Mercator usingthe spherical (rather than ellipsoidal) equations.
| Name | Type | Default | Description |
|---|---|---|---|
ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional The ellipsoid. |
See:
Members
-
The maximum latitude (both North and South) supported by a Web Mercator(EPSG:3857) projection. Technically, the Mercator projection is definedfor any latitude up to (but not including) 90 degrees, but it makes senseto cut it off sooner because it grows exponentially with increasing latitude.The logic behind this particular cutoff value, which is the one used byGoogle Maps, Bing Maps, and Esri, is that it makes the projectionsquare. That is, the rectangle is equal in the X and Y directions.The constant value is computed by calling: WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
-
readonlyellipsoid : Ellipsoid
-
Gets the
Ellipsoid.
Methods
-
Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercatorangle in the range -PI to PI.
Name Type Description latitudeNumber The geodetic latitude in radians. Returns:
The Mercator angle. -
Converts a Mercator angle, in the range -PI to PI, to a geodetic latitudein the range -PI/2 to PI/2.
Name Type Description mercatorAngleNumber The angle to convert. Returns:
The geodetic latitude in radians. -
project(cartographic, result) → Cartesian3
-
Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web MercatorX, Y, Z coordinates expressed in meters and returned in a
Cartesian3. The heightis copied unmodified to the Z coordinate.Name Type Description cartographicCartographic The cartographic coordinates in radians. resultCartesian3 optional The instance to which to copy the result, or undefined if a new instance should be created. Returns:
The equivalent web mercator X, Y, Z coordinates, in meters. -
unproject(cartesian, result) → Cartographic
-
Converts Web Mercator X, Y coordinates, expressed in meters, to a
Cartographiccontaining geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to theheight.Name Type Description cartesianCartesian3 The web mercator Cartesian position to unrproject with height (z) in meters. resultCartographic optional The instance to which to copy the result, or undefined if a new instance should be created. Returns:
The equivalent cartographic coordinates.
