Skip to main content
OnlyMap JS 0.8.0 adds @nika-js/onlymap/cartograph, a separate entry for composing print-ready map sheets in HTML. A cartograph is measured in millimetres, not browser layout units. It can combine live OnlyMap scenes and static georeferenced rasters with legends, scale bars, north indicators, graticules, text, shapes, and images. The cartograph entry is lazy and separate from the interactive-map entry. It does not increase the core map bundle, and a sheet containing only static frames never loads the map runtime.

Frames and cartographic furniture

<om-frame> supports two sources:
  • A live frame contains an inline <om-map> or references a map document with src. The frame owns its camera, so the same map can appear at different extents on one sheet. Export captures it again at the requested print resolution.
  • A static frame uses mode="static", a raster image, crs, and four geographic corners. Scale bars, grids, and north indicators use that georeference without loading the interactive map runtime.
Furniture references a frame with for="frame-id". A live-frame legend derives its rows from the map’s resolved symbology, including classified breaks and raster ramps, so the map and legend cannot drift apart. Static frames can use literal <om-legend-row> entries with derived="false". Use overview-of="main" on a second frame to draw the main frame’s footprint as a locator inset. Text supports page, frame, and atlas tokens such as {{title}}, {{date}}, {{frame.main.scale}}, and {{atlas.name}}. Sheets print at their real physical size through CSS @page. Live WebGL frames are re-rendered and temporarily replaced with print-resolution images before the print dialog opens, avoiding blank or screen-resolution map canvases.
Use page.print({ dpi: 300 }) for print/PDF or renderCartograph(page, { dpi: 300 }) for PNG/JPEG. A hosted cartograph can opt into ?print=1 and ?export=png&dpi=300 automation by setting allow-url-actions on its root. Press-work attributes are available on <om-cartograph>:
  • bleed expands the printable sheet beyond the trim box.
  • crop-marks draws trim marks inside that bleed.
  • safe-zone shows a screen-only guide and never appears in output.
  • flatten renders the final sheet as one raster for print workflows that mishandle SVG or CSS effects.

One page per feature

<om-atlas> turns a layer into a run of sheets—one page per feature. Frames carrying atlas-fit="feature" refit to the current feature, scale bars and tokens update for that page, and renderCartographAtlas() writes the run to one ZIP.
Pages render sequentially through one live map rather than cloning WebGL contexts, so large atlases do not fail at the browser’s context limit.

Colour and validation

Set cvd="deuteranopia", protanopia, tritanopia, or achromatopsia to review the whole page through a colour-vision-deficiency simulation. lintLegendColours() detects legend entries that collapse under those simulations. validateCartographString() checks the page without loading the map core. validateCartographDeep() additionally validates inline live-map manifests when the core is already available. Diagnostics use the same structured error and warning shape as OmMap.validate(). Free non-commercial cartographs include an OnlyMap foot credit in print and image exports. An authored <om-text> credit mentioning OnlyMap satisfies the attribution requirement; a verified commercial key on a live frame removes it. See Licensing & Telemetry. For the complete element and attribute reference, see the package cartograph guide.