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

featuresShownfunction

The features of a layer that are among the choices, in the layer's order (seas first, peaks last).

Import it

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

Definition

function featuresShown(layer: Pick<ChizuFeatureLayer, "features"> | null | undefined, choices?: readonly ChizuFeatureChoice[]): ChizuFeature[]

Parameters

NameTypeDescription
layerPick<ChizuFeatureLayer, "features"> | null | undefined

The native feature layer; its coordinates must match the map used for drawing.

choices (optional)readonly ChizuFeatureChoice[]

Native physical-feature groups, kinds, water or all selections.

Returns

ChizuFeature[]

The features of a layer that are among the choices, in the layer's order (seas first, peaks last).

Examples

import { loadFeatures } from "@johnmorrisdotca/chizu/load";
import { featuresShown } from "@johnmorrisdotca/chizu";

const japan = (await loadFeatures("divisions-jp"))!;
console.log(featuresShown(japan, ["lakes", "rivers"]).map((one) => one.name).join(", "));
// Lake Biwa, Ishikari River, Tone River, Mogami River
Lake Biwa, Ishikari River, Tone River, Mogami River

What it prints (run when this page was built)

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