Skip to the content

Chizu地図

Draw SVG maps, frame regions, place numbered callouts and build geography quizzes with English and Japanese names.

Chizu is the Japanese word 地図 for map. About the name

Contents

Reference · Framing, geometry and quiz tools

landAnchorfunction

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 it

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

Definition

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

Parameters

NameTypeDescription
ringsreadonly MapRing[]

Closed outline rings in native map units.

Returns

[number, number] | null

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

Examples

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 ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chizu 1.5.0.