Skip to content

Projection

Type class

This is a base class for a geographical projection.

Sources

Projection can be used (imported) via one of the following packages.

/**
* Import from: "maps.ts"
* Use like: am4maps.Projection
*/
import * as am4maps from "@amcharts/amcharts4/maps";

Inheritance

Projection does not extend any other symbol.

Projection is extended by Albers, AlbersUsa, AzimuthalEqualArea, Eckert6, EqualEarth, Mercator, Miller, NaturalEarth1, Orthographic, Stereographic.

Properties

d3Projection

Type GeoProjection

d3 projection d3 projection

Methods

constructor()

Returns Projection

convert(geoPoint: IGeoPoint)

Returns IPoint

Converts a geographical point (lat/long) to a screen point (x/y)

distance(pointA: IGeoPoint,
pointB: IGeoPoint
)

Returns number

intermediatePoint(pointA: IGeoPoint,
pointB: IGeoPoint,
position: number
)

Returns IGeoPoint

invert(point: IPoint)

Returns IGeoPoint

Converts a screen point (x/y) to a geographical point (lat/long)

multiDistance(multiGeoLine: Array <Array <IGeoPoint>>)

Returns number

positionToGeoPoint(multiGeoLine: Array <Array <IGeoPoint>>,
position: number
)

Returns IGeoPoint

Converts relative position along the line (0-1) into pixel coordinates.

positionToPoint(multiGeoLine: Array <Array <IGeoPoint>>,
position: number
)

Returns IOrientationPoint

Converts relative position along the line (0-1) into pixel coordinates.

project(lambda: number,
phi: number
)

Returns IPoint

Deprecated Deprecated

Returns X/Y coordinates.

Individual projections will override this method to apply their own projection logic.

unproject(x: number,
y: number
)

Returns IGeoPoint

Deprecated Deprecated

Returns geographical coordinates (lat/long).

Individual projections will override this method to apply their own projection logic.

Events

Projection does not have any events.