Builds the world ↔ pixel mapping for a map image without drawing anything.
Use it to size a canvas ahead of time, or to convert coordinates for an overlay drawn beside an image produced earlier with the same options.
Optional
const t = getMapImageTransform(map, layout, { scale: 2 });canvas.width = t.width; canvas.height = t.height;const { x, y } = t.worldToImage(camera.position.x, camera.position.z); Copy
const t = getMapImageTransform(map, layout, { scale: 2 });canvas.width = t.width; canvas.height = t.height;const { x, y } = t.worldToImage(camera.position.x, camera.position.z);
Builds the world ↔ pixel mapping for a map image without drawing anything.
Use it to size a canvas ahead of time, or to convert coordinates for an overlay drawn beside an image produced earlier with the same options.