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";

/**
 * --------------------------------------------------------
 * Include via: <script src="maps.js"></script>
 * Access items like: am4.Projection
 * --------------------------------------------------------
 */

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

Returns X/Y coordinates.

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

@deprecated
@todo Needs description

unproject(

x: number,
y: number

)

#

Returns IGeoPoint

Returns geographical coordinates (lat/long).

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

@deprecated
@todo Needs description

Events

Projection does not have any events.

Adapters

Projection does not have any adapters.