Constructor
new ProjectionMercator()
Constructs a Mercator geographic projection.
- Source:
Extends
Members
(readonly) continuous :boolean
Indicates whether this projection should be treated as continuous with itself. If true, the 2D map
will appear to scroll continuously horizontally.
Type:
- boolean
- Inherited From:
- Source:
displayName :string
This projection's display name.
Type:
- string
- Inherited From:
- Source:
(readonly) is2D :boolean
Indicates whether this projection is a 2D projection.
Type:
- boolean
- Inherited From:
- Source:
(readonly) projectionLimits :Sector
Indicates the geographic limits of this projection.
Type:
- Inherited From:
- Source:
(readonly) stateKey :String
A string identifying this projection's current state. Used to compare states during rendering to
determine whether globe-state dependent cached values must be updated. Applications typically do not
interact with this property.
Type:
- String
- Source:
Methods
cartesianToGeographic(globe, x, y, z, offset, result) → {Position}
Converts a Cartesian point to a geographic position.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection is applied to. |
x |
number | The X component of the Cartesian point. |
y |
number | The Y component of the Cartesian point. |
z |
number | The Z component of the Cartesian point. |
offset |
Vec3 | An offset to apply to the Cartesian output points. Typically only projections that are continuous (see continuous) apply this offset. Others ignore it. May be null to indicate that no offset is applied. |
result |
Position | A variable in which to return the computed position. |
- Overrides:
- Source:
Throws:
-
If either the specified globe or result argument is null or undefined.
- Type
- ArgumentError
Returns:
The specified result argument containing the computed position.
- Type
- Position
geographicToCartesian(globe, latitude, longitude, elevation, offset, result) → {Vec3}
Converts a geographic position to Cartesian coordinates.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection is applied to. |
latitude |
number | The latitude of the position, in degrees. |
longitude |
number | The longitude of the position, in degrees. |
elevation |
number | The elevation of the position, in meters. |
offset |
Vec3 | An offset to apply to the Cartesian output. Typically only projections that are continuous (see continuous) apply to this offset. Others ignore it. May be null to indicate no offset is applied. |
result |
Vec3 | A variable in which to store the computed Cartesian point. |
- Overrides:
- Source:
Throws:
-
If the specified globe or result is null or undefined.
- Type
- ArgumentError
Returns:
The specified result argument containing the computed point.
- Type
- Vec3
geographicToCartesianGrid(globe, sector, numLat, numLon, elevations, referencePoint, offset, result) → {Float32Array}
Computes a grid of Cartesian points within a specified sector and relative to a specified Cartesian
reference point.
This method is used to compute a collection of points within a sector. It is used by tessellators to efficiently generate a tile's interior points. The number of points to generate is indicated by the tileWidth and tileHeight parameters but is one more in each direction. Width refers to the longitudinal direction, height to the latitudinal.
For each implied position within the sector, an elevation value is specified via an array of elevations. The calculation at each position incorporates the associated elevation. There must be (tileWidth + 1) x (tileHeight + 1) elevations in the array.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection applies to. |
sector |
Sector | The sector in which to compute the points. |
numLat |
Number | The number of latitudinal sections a tile is divided into. |
numLon |
Number | The number of longitudinal sections a tile is divided into. |
elevations |
Array.<Number> | An array of elevations to incorporate in the point calculations. There must be one elevation value in the array for each generated point. Elevations are in meters. There must be (tileWidth + 1) x (tileHeight + 1) elevations in the array. |
referencePoint |
Vec3 | The X, Y and Z Cartesian coordinates to subtract from the computed coordinates. This makes the computed coordinates relative to the specified point. May be null. |
offset |
Vec3 | An offset to apply to the Cartesian output points. Typically only projections that are continuous (see continuous) apply this offset. Others ignore it. May be null to indicate that no offset is applied. |
result |
Float32Array | A typed array to hold the computed coordinates. It must be at least of size (tileWidth + 1) x (tileHeight + 1) * 3. The points are returned in row major order, beginning with the row of minimum latitude. |
- Overrides:
- Source:
Throws:
-
if any of the specified globe, sector, elevations array or results arrays is null or undefined.
- Type
- ArgumentError
Returns:
The specified result argument, populated with the computed Cartesian coordinates.
- Type
- Float32Array
northTangentAtLocation(globe, latitude, longitude, result)
Computes a Cartesian vector that points north and is tangent to the meridian at a specified geographic
location.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection is applied to. |
latitude |
number | The latitude of the location, in degrees. |
longitude |
number | The longitude of the location, in degrees. |
result |
Vec3 | A variable in which to return the computed vector. |
- Inherited From:
- Source:
Throws:
-
If either the specified globe or result argument is null or undefined.
- Type
- ArgumentError
northTangentAtPoint(globe, x, y, z, offset, result)
Computes a Cartesian vector that points north and is tangent to the meridian at a specified Cartesian
point.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection is applied to. |
x |
number | The X component of the Cartesian point. |
y |
number | The Y component of the Cartesian point. |
z |
number | The Z component of the Cartesian point. |
offset |
Vec3 | An offset to apply to the Cartesian point. Typically only projections that are continuous (see continuous) apply this offset. Others ignore it. May be null to indicate that no offset is applied. |
result |
Vec3 | A variable in which to return the computed vector. |
- Inherited From:
- Source:
Throws:
-
If either the specified globe or result argument is null or undefined.
- Type
- ArgumentError
surfaceNormalAtLocation(globe, latitude, longitude, result)
Computes the Cartesian surface normal vector at a specified geographic location.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection is applied to. |
latitude |
number | The latitude of the location, in degrees. |
longitude |
number | The longitude of the location, in degrees. |
result |
Vec3 | A variable in which to return the computed vector. |
- Inherited From:
- Source:
Throws:
-
If either the specified globe or result argument is null or undefined.
- Type
- ArgumentError
surfaceNormalAtPoint(globe, x, y, z, result)
Computes the Cartesian surface normal vector at a specified Cartesian point.
Parameters:
Name | Type | Description |
---|---|---|
globe |
Globe | The globe this projection is applied to. |
x |
number | The X component of the Cartesian point. |
y |
number | The Y component of the Cartesian point. |
z |
number | The Z component of the Cartesian point. |
result |
Vec3 | A variable in which to return the computed vector. |
- Inherited From:
- Source:
Throws:
-
If either the specified globe or result argument is null or undefined.
- Type
- ArgumentError