Overview
Map projections transform the 3D surface of the Earth onto a 2D plane. amCharts 5 uses d3-geo projections and re-exports the most commonly used ones. Different projections have different characteristics and are suited for different purposes. Some preserve areas, others preserve angles, and none can preserve both perfectly.Importing Projections
Projections are imported from the map module:Built-in Projections
amCharts 5 re-exports these commonly used projections from d3-geo:geoMercator
The Mercator projection is a cylindrical map projection that preserves angles but distorts sizes, especially near the poles. It’s the default projection used by amCharts 5.- Preserves angles (conformal)
- Distorts areas, especially near poles
- Commonly used for navigation and web maps
- Cannot show the poles
geoOrthographic
The orthographic projection shows the Earth as it would appear from outer space. It’s a perspective projection that shows one hemisphere at a time.- Shows one hemisphere at a time
- Creates a globe-like appearance
- Severe distortion near the edges
- Supports rotation via
rotationX,rotationY,rotationZ
panX: "rotateX" and panY: "rotateY" for globe rotation on drag.
geoEquirectangular
The equirectangular projection (also called the plate carrée projection) maps meridians to vertical straight lines and parallels to horizontal straight lines.- Simple rectangular projection
- Neither conformal nor equal-area
- Meridians and parallels are straight lines
- Significant distortion at high latitudes
geoAlbersUsa
A composite projection specifically designed for the United States, including Alaska and Hawaii.- Composite conic projection
- Includes Alaska and Hawaii repositioned
- Equal-area projection
- Only works for United States
geoEqualEarth
The Equal Earth projection is an equal-area pseudocylindrical projection designed in 2018 for world maps.- Equal-area projection
- Modern design (2018)
- Pleasing visual appearance
- Suitable for thematic world maps
geoNaturalEarth1
The Natural Earth projection is a pseudocylindrical projection designed to present a pleasing, moderately distorted view of the entire world.- Compromise projection (balances distortion)
- Neither equal-area nor conformal
- Aesthetically pleasing for world maps
- Moderate distortion throughout
Using Other d3-geo Projections
You can use any projection from d3-geo or d3-geo-projection:Additional d3-geo Projections
Some other useful projections from d3-geo:- geoConicEqualArea - Conic equal-area projection
- geoConicConformal - Lambert conformal conic projection
- geoStereographic - Stereographic projection
- geoAzimuthalEqualArea - Lambert azimuthal equal-area projection
- geoGnomonic - Gnomonic projection
- geoTransverseMercator - Transverse Mercator projection
Projection Configuration
Projections can be configured before being passed to the MapChart:homeZoomLevel, homeGeoPoint, rotationX, and rotationY instead.
Projection Rotation
Some projections (likegeoOrthographic) support rotation to change the visible portion of the globe:
Animating Between Projections
You can smoothly animate transitions between different projections using theanimateProjection method:
geoOrthographicRaw) because d3-geo doesn’t expose it on the projection instance.
Choosing a Projection
Different projections serve different purposes:For World Maps
- geoMercator - General purpose, navigation
- geoEqualEarth - Thematic maps, equal-area
- geoNaturalEarth1 - Aesthetically pleasing compromise
- geoOrthographic - Globe view
For Regional Maps
- geoAlbersUsa - United States (with Alaska and Hawaii)
- geoConicEqualArea - Large regions, equal-area
- geoConicConformal - Large regions, conformal
For Special Purposes
- geoOrthographic - Satellite view, globe
- geoStereographic - Polar regions
- geoGnomonic - Great circle navigation