loadKuniCities関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { loadKuniCities } from "@johnmorrisdotca/chizu/cities";
定義
function loadKuniCities(...tiers: readonly CityTier[]): Promise<readonly ChizuCity[]>
引数
| 名前 | 型 | 説明 |
|---|---|---|
...tiers | readonly CityTier[] | The kuni tiers to load; default |
戻り値
Promise<readonly ChizuCity[]>
The cities, in the shape the city layer reads.
例
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この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。