OptionalscalePixels per world unit. Default: 4. Controls output resolution.
OptionalpaddingPadding in pixels on each side. Default: 2.
OptionalbackgroundCSS color string for cells with unknown terrain indices. Default: '#1a1a1a'.
OptionaltypeOutput MIME type. Default: 'image/png'. Ignored by drawMapImage.
OptionalqualityJPEG/WebP quality 0–1. Default: 0.92. Ignored for PNG and by drawMapImage.
OptionalelevationDarken or lighten cells based on elevation. Each elevation step multiplies brightness by this factor (>1 = lighter, <1 = darker). Default: 0 (disabled).
OptionalfogFog-of-war data to apply. When provided, cells are shaded by visibility state.
Use fogDimOpacity and fogHideUnexplored to control how fog is drawn.
OptionalfogOpacity of the black overlay drawn over explored-but-not-currently-visible cells.
0 = no dimming, 1 = fully black. Default: 0.5. Has no effect without fog.
OptionalfogIf true, cells that have never been explored are rendered solid black.
Default: false. Has no effect without fog.
OptionalcellPer-cell overlay color, painted over the terrain fill. Return a CSS color
(use rgba(...) to tint rather than replace) or null to leave the cell
alone. This is the hook for anything the map itself doesn't describe —
territory ownership, resource highlights, a selection.
Called once per cell, so keep it cheap.
OptionalriversDraw river channels as lines through each cell. Default: false.
OptionalroadsDraw roads as lines through each cell. Default: false.
OptionaltransparentClear the canvas to transparent before drawing instead of filling it with
background. Default: false. Only meaningful for drawMapImage.
Placement options shared by the transform and the renderer.