Reference · Framing, geometry and quiz tools
overlaysSvgfunction
The overlays as SVG: one group, cz-overlays, the areas first, then the lines, then the marks, each repeated at the
whole-width shifts round a world map that reach the window. Points that are not numbers are left out; a latitude past
a pole is held to it.
Import it
import { overlaysSvg } from "@johnmorrisdotca/chizu";
Definition
function overlaysSvg(map: ChizuMap, overlays: readonly ChizuOverlay[], box: MapBox): string
Parameters
| Name | Type | Description |
|---|---|---|
map | ChizuMap | The map they are drawn on. |
overlays | readonly ChizuOverlay[] | The overlays, in the order they are drawn within their kind. |
box | MapBox | The window shown: the copies round a world map reach it, and a mark's label is sized to it. |
Returns
string
The group, empty when there is nothing to draw.
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import { overlaysSvg, wholeMapBox } from "@johnmorrisdotca/chizu";
const svg = overlaysSvg(WORLD, [{ kind: "mark", at: [0, 0], label: "0, 0" }], wholeMapBox(WORLD));
console.log(svg.includes('class="cz-overlay-mark"'));
// truetrueWhat it prints (run when this page was built)