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

boxIsWholeMapfunction

True when the box shows the whole map rather than a zoomed-in window.

Import it

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

Definition

function boxIsWholeMap(map: Pick<ChizuMap, "width" | "height">, box: MapBox): boolean

Parameters

NameTypeDescription
mapPick<ChizuMap, "width" | "height">

The native map or map fields required by this signature; coordinates and region codes belong to its canvas.

boxMapBox

The window in native map units, or the inset destination specified by this signature.

Returns

boolean

True when the box shows the whole map rather than a zoomed-in window.

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { boxIsWholeMap, focusBox, wholeMapBox } from "@johnmorrisdotca/chizu";

console.log(boxIsWholeMap(WORLD, wholeMapBox(WORLD)), boxIsWholeMap(WORLD, focusBox(WORLD, ["JP"])));
// true false
true false

What it prints (run when this page was built)

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