mountChizufunction
Puts a map in an element, to look at by touch, mouse and keyboard: drag to move it, the buttons, the wheel or a pinch to
zoom in ten steps, a press to choose a region, the arrow keys and plus and minus. The world wraps: it pans east and
west without stopping. Every part of it is the package's own drawing (drawChizu) in the page's own DOM, with no shadow
DOM and nothing the page's style cannot reach.
Import it
import { mountChizu } from "@johnmorrisdotca/chizu/mount";
Definition
function mountChizu(host: HTMLElement, initial: ChizuMountOptions): ChizuMount
Parameters
| Name | Type | Description |
|---|---|---|
host | HTMLElement | The page or shadow-root element that receives the native map and its scoped styles. |
initial | ChizuMountOptions | The initial native map, framing, display settings and interaction callbacks. |
Returns
ChizuMount
The mounted native map handle; call destroy when removing its host.
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import { mountChizu } from "@johnmorrisdotca/chizu/mount";
const mount = mountChizu(document.querySelector<HTMLElement>("#map")!, {
map: WORLD,
onSelect: (code) => console.log("chosen", code),
});
mount.show(["JP", "KR"]);