Reference · Map, locator and quiz elements
loadElementMapfunction
Load a built-in map by world, country-<ISO> or divisions-<ISO>. Invalid names return null.
Import it
import { loadElementMap } from "@johnmorrisdotca/chizu/element";
Also exported from: @johnmorrisdotca/chizu/element/define
Definition
function loadElementMap(region: string): Promise<MapData | null>
Parameters
| Name | Type | Description |
|---|---|---|
region | string | The built-in map id, such as world or country-jp. |
Returns
Promise<MapData | null>
The loaded native map, or null for an unavailable map id.
Examples
import { loadElementMap } from "@johnmorrisdotca/chizu/element";
console.log((await loadElementMap("country-jp"))?.id, await loadElementMap("invalid"));
// country-jp nullcountry-jp nullWhat it prints (run when this page was built)