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 · Country names and groups

countryByCodefunction

The country with this code (upper or lower case), or undefined.

Import it

import { countryByCode } from "@johnmorrisdotca/chizu/names";

Definition

function countryByCode(code: string): ChizuCountry | undefined

Parameters

NameTypeDescription
codestring

The native region or country code; null clears a region selection where accepted.

Returns

ChizuCountry | undefined

The matching country, or undefined when the code is unknown.

Examples

import { countryByCode } from "@johnmorrisdotca/chizu/names";

const japan = countryByCode("jp")!;
console.log(japan.name, japan.nameJa, japan.reading, japan.hasDivisions);
// Japan 日本 にほん true
Japan 日本 にほん true

What it prints (run when this page was built)

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