Reference · Framing, geometry and quiz tools
ChizuFeatureLayertype
The named features of one map, drawn on that map's canvas: what loadFeatures(mapId) gives, and what drawChizu
and mountChizu take as featureLayer.
Import it
import type { ChizuFeatureLayer } from "@johnmorrisdotca/chizu";
Definition
interface ChizuFeatureLayer {
map: string;
source: string;
features: ChizuFeature[];
}
Members
| Name | Type | Description |
|---|---|---|
map | string | The id of the map whose canvas the features are drawn on. |
source | string | Where the shapes and names come from, in a line. |
features | ChizuFeature[] |
Examples
import { loadFeatures } from "@johnmorrisdotca/chizu/load";
import type { ChizuFeatureLayer } from "@johnmorrisdotca/chizu";
const layer: ChizuFeatureLayer = (await loadFeatures("world"))!;
console.log(layer.map, layer.features.some((one) => one.name === "Caspian Sea"));
// world trueworld trueWhat it prints (run when this page was built)