本文へ移動

Chizu地図

SVGの地図を描き、地域を表示範囲に収め、番号付きの注記や地理クイズを英語と日本語の名前で作れます。

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

目次

リファレンス · 地図と地物を読み込む

loadWorldDetail関数

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

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. For mountChizu's detail, which draws it from the fourth zoom step in, where the coarse coasts would look angular; everything else (framing, quizzes, callouts) keeps to the world itself, whose codes, names and neighbours it shares.

インポート

import { loadWorldDetail } from "@johnmorrisdotca/chizu/load";

定義

function loadWorldDetail(): Promise<ChizuMap>

戻り値

Promise<ChizuMap>

The finer world map with the same canvas and country codes as the coarse world map.

例

import { loadWorldDetail } from "@johnmorrisdotca/chizu/load";
import WORLD from "@johnmorrisdotca/chizu/world";

const detail = await loadWorldDetail();
const japan = (map: typeof WORLD) => map.regions.find((region) => region.code === "JP")!.path.length;
console.log(detail.id, japan(detail) > japan(WORLD) * 3);
// world-detail true
world-detail true

出力(このページを作ったときに実行した結果)

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

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