Projections
geo.projection picks how the sphere gets flattened. ApexMaps wraps d3-geo rather than reimplementing spherical math, and defaults to Equal Earth rather than Web Mercator, because a world thematic map in Mercator overstates high-latitude area by an order of magnitude, exactly wrong when area encodes a value.
geo: { projection: 'equalEarth' } // name
geo: { projection: { name: 'mercator', rotate: [-100, 0] } } // spec object
Switching projection reprojects the geometry once and refits the view. Panning and zooming afterward never reproject.
Built-in projections
ApexMaps registers 16 distinct projections under 20 names, a few carry aliases for the names developers arriving from tile-based libraries or GIS tooling reach for.
| Name | Aliases | Family |
|---|---|---|
equalEarth | Pseudo-cylindrical, equal-area. Default | |
mercator | webMercator, epsg:3857 | Cylindrical, conformal |
equirectangular | plateCarree, epsg:4326 | Cylindrical, raw lon/lat |
naturalEarth | Pseudo-cylindrical, compromise | |
orthographic | Azimuthal, the globe view | |
albers | Conic, equal-area | |
albersUsa | Composite conic, insets Alaska and Hawaii | |
conicConformal | Conic, conformal | |
conicEqualArea | Conic, equal-area | |
conicEquidistant | Conic, equidistant | |
azimuthalEqualArea | Azimuthal, equal-area | |
azimuthalEquidistant | Azimuthal, equidistant | |
gnomonic | Azimuthal, great circles as straight lines | |
stereographic | Azimuthal, conformal | |
transverseMercator | Cylindrical, rotated 90° | |
identity | Passthrough, for already-projected or pixel-space input |
All 16 are free in every license tier, including Community. ApexMaps.listProjections() returns every registered name, built-in and custom.
Spec objects
Pass an object instead of a bare name to rotate, recenter, or clip a projection:
geo: {
projection: { name: 'conicEqualArea', rotate: [-100, 0], parallels: [50, 70] }
}
| Field | Applies to | Purpose |
|---|---|---|
rotate | most projections | [lambda, phi] or [lambda, phi, gamma] in degrees. How a Pacific-centered world, or a country crossing the antimeridian, gets drawn without tearing |
center | most projections | [lon, lat] to center on |
parallels | the three conic projections | Standard parallels |
angle | projections that support it | Post-projection rotation, in degrees |
clipAngle | azimuthal and related projections | Antipodal clipping angle |
clipExtent | any projection | A [[x0, y0], [x1, y1]] world-space clip rectangle |
reflectX, reflectY | any projection | Mirror an axis |
albersUsa is a fixed composite of three sub-projections (the continental US, an inset Alaska, an inset Hawaii), so rotate and center are ignored for it: mutating either would break the composite layout. Every other field on the spec still applies.
Only orthographic, gnomonic, stereographic, the azimuthal pair, albersUsa, identity, and the conics show a single hemisphere or region rather than the whole sphere, which is why geo.sphere and geo.graticule are most useful with the others.
Registering a custom projection
The 16 built-in projections cover what d3-geo itself ships. Everything else, Mollweide, Robinson, Winkel Tripel, Eckert, Bonne, and the rest of d3-geo-projection, is registered by hand:
import ApexMaps from 'apexmaps'
import { geoRobinson } from 'd3-geo-projection'
ApexMaps.registerProjection('robinson', geoRobinson)
const map = new ApexMaps(el, {
geo: { map: 'world/countries@110m', projection: 'robinson' },
series: [{ joinBy: 'iso_a3', data }],
})
registerProjection() itself is free, so is every one of the 16 built-ins. What is licensed is rendering a map with a projection you registered: it works without a key for evaluation, with a watermark, exactly like the other licensed features. Re-registering a built-in name over the built-in (registering your own 'mercator' factory, say) stays free, since the gate is on the name asked for, not on how many custom factories are in the registry.
ApexMaps.registerProjection(name, factory) takes a name and a zero-argument factory returning a d3-geo-style projection, the same shape every built-in uses internally.