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
| Name | Type | Description |
|---|---|---|
layer | Pick<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 RiverLake Biwa, Ishikari River, Tone River, Mogami RiverWhat it prints (run when this page was built)