Class: Cartographic

Cartographic

new Cartographic(longitude, latitude, height)

The spatial position defined by longitude, latitude, and altitude.

Name Type Default Description
longitude Number 0.0 optional

Longitude measured in radians.

latitude Number 0.0 optional

Latitude measured in radians.

height Number 0.0 optional

The height measured in meters.

See:

Members

(static, constant) ZEROCartographic

The map instance is initialized to (0.0, 0.0, 0.0).

heightNumber

The height of an ellipsoid measured in meters.

Default Value:
0.0

latitudeNumber

Latitude measured in radians.

Default Value:
0.0

longitudeNumber

Longitude measured in radians.

Default Value:
0.0

Methods

static clone(cartographic, result){Cartographic}

Copy the Cartographic instance.

Name Type Description
cartographic Cartographic

The object to be copied.

result Cartographic optional

The object that stores the results.

Returns:
Type Description
Cartographic If the modified result parameters are not provided, return a new Cartographic instance; If the provided cartographical coordinates are undefined, return undefined.

static equals(left, right){Boolean}

Compare two maps and return true if their values are equal, otherwise return false.

Name Type Description
left Cartographic optional

The first map.

right Cartographic optional

The second map.

Returns:
Type Description
Boolean Return true if the values of two maps are equal, otherwise return false.

static equalsEpsilon(left, right, epsilon){Boolean}

Compare two maps and return true if their values are less than the specified value, otherwise return false.

Name Type Description
left Cartographic optional

The first map.

right Cartographic optional

The second map.

epsilon Number

The value epsilon used for equivalence testing.

Returns:
Type Description
Boolean If the values of two maps are less than the specified value, return true; otherwise, return false.

static fromCartesian(cartesian, ellipsoid, result){Cartographic}

Create a Cartographic instance based on the Cartesian coordinates (Cartesian 3) position. The result data is measured in radians.

Name Type Default Description
cartesian Cartesian3

The Cartesian coordinates (Cartesian 3) position to be converted into a Cartesian representation.

ellipsoid Ellipsoid Ellipsoid.WGS84 optional

Ellipsoid body.

result Cartographic optional

The object that stores the results.

Returns:
Type Description
Cartographic If the modified result parameters are not provided, return a new Cartographic instance.

static fromDegrees(longitude, latitude, height, result){Cartographic}

Create a Cartographic instance based on longitude and latitude values measured in degrees. The result data is measured in radians.

Name Type Default Description
longitude Number

Longitude measured in degrees.

latitude Number

Latitude measured in degrees.

height Number 0.0 optional

The height of an ellipsoid measured in meters.

result Cartographic optional

The object that stores the results.

Returns:
Type Description
Cartographic If the modified result parameters are not provided, return a new Cartographic instance.

static fromRadians(longitude, latitude, height, result){Cartographic}

Create a Cartographic instance based on longitude and latitude values measured in radians.

Name Type Default Description
longitude Number

Longitude measured in radians.

latitude Number

Latitude measured in radians.

height Number 0.0 optional

The height of an ellipsoid measured in meters.

result Cartographic optional

The object that stores the results.

Returns:
Type Description
Cartographic If the modified result parameters are not provided, return a new Cartographic instance.

static sphericalDistance(longitudeA, latitudeA, longitudeB, latitudeB){Number}

Calculate the spherical distance between two points.

Name Type Description
longitudeA Number

Specify the longitude of the first point in degrees.

latitudeA Number

Specify the latitude of the first point in degrees.

longitudeB Number

Specify the longitude of the second point in degrees.

latitudeB Number

Specify the latitude of the second point in degrees.

Returns:
Type Description
Number The distance value between two points.

static toCartesian(cartographic, ellipsoid, result){Cartesian3}

Create a Cartesian (Cartesian3) instance based on the Cartographic coordinate position. The input value is in radians.

Name Type Default Description
cartographic Cartographic

To be converted into Cartesian coordinates (Cartesian3) representing the Cartographic position.

ellipsoid Ellipsoid Ellipsoid.WGS84 optional

Ellipsoid body.

result Cartesian3 optional

Object for storing results

Returns:
Type Description
Cartesian3 If the modified result parameters are not provided, return a new Cartesian3 instance.

toString(){String}

Create a string representing the map in the format of '(longitude, latitude, altitude)'.

Returns:
Type Description
String A string representing a map in the format of '(longitude, latitude, altitude)'.