loadKuniCitiesfunction
Kuni's cities, each once, ready for drawChizu's cities: the tiers asked for (capitals, 1m, 100k, 15k), or
CHIZU_CITY_TIERS. Each tier is loaded only when it is asked for, and kept by kuni once loaded.
Import it
import { loadKuniCities } from "@johnmorrisdotca/chizu/cities";
Definition
function loadKuniCities(...tiers: readonly CityTier[]): Promise<readonly ChizuCity[]>
Parameters
| Name | Type | Description |
|---|---|---|
...tiers | readonly CityTier[] | The kuni tiers to load; default |
Returns
Promise<readonly ChizuCity[]>
The cities, in the shape the city layer reads.
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import { drawChizu } from "@johnmorrisdotca/chizu/draw";
import { loadKuniCities } from "@johnmorrisdotca/chizu/cities";
const svg = drawChizu(WORLD, { cities: await loadKuniCities(), language: "ja", style: true });
console.log(svg.includes('class="cz-cities"'));
// true