Skip to content

KBE3D / KBCore / Cesium / WebMercatorProjection

类: WebMercatorProjection

The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using the spherical (rather than ellipsoidal) equations.

参数

The ellipsoid.

属性

MaximumLatitude

static MaximumLatitude: number

The maximum latitude (both North and South) supported by a Web Mercator (EPSG:3857) projection. Technically, the Mercator projection is defined for any latitude up to (but not including) 90 degrees, but it makes sense to cut it off sooner because it grows exponentially with increasing latitude. The logic behind this particular cutoff value, which is the one used by Google Maps, Bing Maps, and Esri, is that it makes the projection square. That is, the rectangle is equal in the X and Y directions.

The constant value is computed by calling: WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)


ellipsoid

readonly ellipsoid: Ellipsoid

Gets the Ellipsoid.

方法

mercatorAngleToGeodeticLatitude()

static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number

Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude in the range -PI/2 to PI/2.

参数

mercatorAngle

number

The angle to convert.

返回

number

The geodetic latitude in radians.


geodeticLatitudeToMercatorAngle()

static geodeticLatitudeToMercatorAngle(latitude: number): number

Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator angle in the range -PI to PI.

参数

latitude

number

The geodetic latitude in radians.

返回

number

The Mercator angle.


project()

project(cartographic: Cartographic, result?: Cartesian3): Cartesian3

Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator X, Y, Z coordinates expressed in meters and returned in a Cartesian3. The height is copied unmodified to the Z coordinate.

参数

cartographic

Cartographic

The cartographic coordinates in radians.

result?

Cartesian3

The instance to which to copy the result, or undefined if a new instance should be created.

返回

Cartesian3

The equivalent web mercator X, Y, Z coordinates, in meters.


unproject()

unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic

Converts Web Mercator X, Y coordinates, expressed in meters, to a Cartographic containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the height.

参数

cartesian

Cartesian3

The web mercator Cartesian position to unrproject with height (z) in meters.

result?

Cartographic

The instance to which to copy the result, or undefined if a new instance should be created.

返回

Cartographic

The equivalent cartographic coordinates.

构造函数

构造函数

new WebMercatorProjection(ellipsoid?: Ellipsoid): WebMercatorProjection

参数

ellipsoid?

Ellipsoid

返回

WebMercatorProjection

KBE3D @3.0.0 Copyright © 2024-present KBE3D