本文へ移動

Chizu地図

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

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

目次

リファレンス

操作できる地図

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

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

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

Chizu in a page: mountChizu draws a map into any element and lets a person look around it by touch, mouse and keyboard: drag to move, the buttons, wheel or a pinch to zoom in ten steps, a press to choose a region. The world pans round without stopping. A separate entry (@johnmorrisdotca/chizu/mount), so a server never loads any of it.

エクスポート

名前種類概要
CHIZU_MAP_STYLE定数THE STYLE a mounted map wears, beside the drawing's own (CHIZU_STYLE): the frame the map sits in, the zoom buttons over its corner and the line a screen reader is told what was chosen on.
ChizuMount型The mounted native map’s drawing updates, selected region, framing, loaded features and cleanup handle.
ChizuMountOptions型What a mounted map is told.
ChizuView型Where a mounted map is looking.
ensureChizuMapStyle関数Put the style in the page once: in the document's head, or in the shadow root the host is in.
mountChizu関数Puts a map in an element, to look at by touch, mouse and keyboard: drag to move it, the buttons, the wheel or a pinch to zoom in ten steps, a press to choose a region, the arrow keys and plus and minus.

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

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