本文へ移動

Chizu地図

世界、253の国、33か国の州や県などの地域を、SVGの地図に描けます。表示する範囲を決めたり、番号付きの注記をつけたり、地理クイズを作ったりもできます。名前は今のところ英語と日本語で、スペイン語、ドイツ語、中国語にも対応する予定です。

「地図」は、土地や場所を図で表したものです。 名前について(英語)

目次

リファレンス

/cities

import { … } from "@johnmorrisdotca/chizu/cities";

最小化と gzip 圧縮をしたサイズは 1565.2 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The world's cities for Chizu's city layer, from kuni: its own entry (@johnmorrisdotca/chizu/cities), the one part of Chizu that needs @johnmorrisdotca/kuni (an optional peer, 1.6.0 or later). A page that names no cities never loads it, and one that has its own list passes that to drawChizu's cities instead.

エクスポート

名前種類概要
CHIZU_CITY_TIERS定数The tiers loaded when none are asked for: every capital and every city of 100,000 people or more, about 9,000 cities.
ChizuCity型One city as the layer reads it: the fields of kuni's City that a map needs, so a kuni city is one as it is.
ChizuCityOptions型How the city layer is drawn: drawChizu's cityOptions.
ChizuCityPlaced型A city placeCities named: where its dot is on the canvas, the name printed and the side of the dot it is on.
loadKuniCities関数Kuni's cities, each once, ready for drawChizu's cities: the tiers asked for (capitals, 1m, 100k, 15k), or CHIZU_CITY_TIERS.

ソースを見るGitHub で編集@johnmorrisdotca/chizu 1.17.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。