A map projection including all US overseas territories.
If you're using a <script>
tag to pull in the library, be sure to use the distribution bundle, for example using a Content Distribution Netowork such as Unpkg like this:
<script src="https://unpkg.com/[email protected]/dist/geo-albers-usa-territories.js"></script>
Otherwise, you can use it as a dependency with NPM (npm install geo-albers-usa-territories
) and require
it like this:
const geoAlbersUsaTerritories = require("geo-albers-usa-territories")
Or, if your environment suppots ES6 modules:
import geoAlbersUsaTerritories from "geo-albers-usa-territories";
Here's a complete working example that uses this library.
Original source: https://observablehq.com/@almccon/u-s-map-with-puerto-rico-us-virgin-islands-american-samoa-gua
An extension of https://observablehq.com/@d3/u-s-map-with-puerto-rico
Which in turn was derived from https://github.com/d3/d3-geo/blob/master/src/projection/albersUsa.js
Note that this package marks d3-geo
as a peerDependency
, so you'll need to directly depend on d3-geo
as well as this package. This is to avoid the possibility of bundling multiple copies of d3-geo
.