overlaysSvg関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { overlaysSvg } from "@johnmorrisdotca/chizu";
定義
function overlaysSvg(map: ChizuMap, overlays: readonly ChizuOverlay[], box: MapBox): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
string
The group, empty when there is nothing to draw.
例
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"'));
// truetrue出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。