Reference
Load maps and features
import { … } from "@johnmorrisdotca/chizu/load";
6614.0 kB minified and gzipped, with everything it imports (measured with esbuild)
Loading a map by name, one country at a time: loadCountry("fr") is France alone, loadDivisions("fr") its
départements. Each is a dynamic import of a file of its own, so a bundler makes a chunk for each and a page fetches
only the ones it draws.
Exports
| Name | Kind | What it is |
|---|---|---|
COUNTRY_CODES | constant | Every country that has a map of its own, by code, upper or lower case. |
DIVISIONS_CODES | constant | Every country that has a map of its own regions (provinces, states, départements), by code. |
FEATURE_MAPS | constant | The ids of every map that has named features of its own: the world, and each country alone or by its regions whose canvas holds a sea, a lake, a river, a landform or a peak big enough to see. |
loadCountry | function | One country alone, drawn from Natural Earth's 1:50m countries (the small ones from 1:10m); null for a code with no map. |
loadDivisions | function | The regions of one country, from Natural Earth's 1:10m states and provinces; null for a country that has none. |
loadFeatures | function | The named features of a map (its seas, lakes, rivers, landforms and peaks), drawn on its own canvas, by the map or its id: a file of its own, fetched only when asked for. |
loadWorldDetail | function | The world drawn finer: the same 173 countries on the same canvas, in the same projection, from Natural Earth's 1:50m outlines rather than its 1:110m ones, about 1.3 MB. |