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

portNamefunction

A place's name in a language: Japanese on a Japanese page where it has one, else English.

Import it

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

Definition

function portName(port: Pick<ChizuPort, "name">, language: ChizuLanguage): string

Parameters

NameTypeDescription
portPick<ChizuPort, "name">

The place.

languageChizuLanguage

en or ja.

Returns

string

Its name.

Examples

import { portName, type ChizuPort } from "@johnmorrisdotca/chizu";

const port: ChizuPort = { id: "yokohama", kind: "harbour", name: { en: "Yokohama", ja: "横浜港" }, country: "JP", lat: 35.45, lon: 139.65, tier: 1 };
console.log(portName(port, "en"), portName(port, "ja"));
// Yokohama 横浜港
Yokohama 横浜港

What it prints (run when this page was built)

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