本文へ移動

Chizu地図

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

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

目次

リファレンス · 表示範囲・形・クイズの道具

MAP_ZOOM_LEVELS定数

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

How far in the map is drawn, as steps rather than a free zoom. A free zoom would offer a hundred framings of which a few are useful: the steps are those, plus the whole map to come back to. Ten whole steps, 1× to 10×: the maps are vector outlines whose lines keep their width on the screen at any step, and at 5× a city prefecture, a ward or a country such as Luxembourg or Singapore was still a few pixels across. The first step is always 1× and the last the deepest, so code that reads MAP_ZOOM_LEVELS[0] and MAP_ZOOM_LEVELS.at(-1) for its buttons follows the ladder.

インポート

import { MAP_ZOOM_LEVELS } from "@johnmorrisdotca/chizu";

定義

const MAP_ZOOM_LEVELS: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as const

例

import { MAP_ZOOM_LEVELS } from "@johnmorrisdotca/chizu";

console.log(MAP_ZOOM_LEVELS.join(" "));
// 1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10

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

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

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