Skip to the content

Chizu地図

Draw SVG maps of the world, its 253 countries and the regions of 33 of them, frame them, place numbered callouts and build geography quizzes, with names in English and Japanese today (Spanish, German and Chinese are planned).

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

Contents

Reference · Framing, geometry and quiz tools

portTierForfunction

The tier a window shows: 1 across more than 3,000 km, 2 across more than 1,000 km, else 3.

Import it

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

Definition

function portTierFor(kilometres: number): 1 | 2 | 3

Parameters

NameTypeDescription
kilometresnumber

The ground the window shows across, in kilometres (windowKilometres).

Returns

1 | 2 | 3

1, 2 or 3.

Examples

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

console.log(portTierFor(8000), portTierFor(2000), portTierFor(300));
// 1 2 3
1 2 3

What it prints (run when this page was built)

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