本文へ移動

Chizu地図

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

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

目次

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

landAnchor関数

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

A point on the region's own land, for a leader to end at.

region.map.centroid is the average of a whole outline, so it falls in open water whenever a place is a chain or a crescent: measured on 2026-09-18, 15 of the world's 173 countries - Indonesia, Japan, Malaysia, the Philippines, Vietnam, Israel, France, Croatia among them - and a leader drawn to it ends in the sea between the islands it is naming.

The biggest ring is the region as anyone would point at it, and inside it the chosen point is the one furthest from its coast: the pole of inaccessibility, found by quartering the ring's box and keeping the best square, which is a few hundred steps and exact enough for a circle's leader. A ring so thin that no sample lands inside it - a sandbar - falls back to the ring's own middle.

インポート

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

定義

function landAnchor(rings: readonly MapRing[]): [number, number] | null

引数

名前型説明
ringsreadonly MapRing[]

Closed outline rings in native map units.

戻り値

[number, number] | null

A point on the widest ring’s land, or null when no ring exists.

例

import { landAnchor, parseMapRings } from "@johnmorrisdotca/chizu";

// The point deepest in the land of the widest ring.
console.log(landAnchor(parseMapRings("M0,0L20,0L20,10L0,10Z")));
// [ 5, 5 ]
[ 5, 5 ]

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

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

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