hex-world
    Preparing search index...

    Function renderMapImage

    • Renders a flat top-down image of the map using terrain colors. Returns a Blob (PNG by default) suitable for download, a saved thumbnail, or passing to URL.createObjectURL.

      For a minimap that updates as the map is edited, use drawMapImage against a visible canvas instead — it skips the encode/decode round trip.

      Parameters

      Returns Promise<Blob>

      const blob = await renderMapImage(map, layout, DEFAULT_TERRAIN_DEFINITIONS);
      thumbnail.src = URL.createObjectURL(blob);