packages/skills/skills/remotion-maps/techniques/maptiler/references/render-stability.md
Read this reference before building a moving 2D MapTiler scene or diagnosing a wavering Remotion render.
If basemap detail shimmers or jitters during a pan/zoom, the likely cause is per-frame map.jumpTo().
Headless MapTiler capture can resample both vector hillshade and satellite imagery differently frame to
frame. Tile retries, easing changes, and label changes do not solve that renderer effect.
For any 2D pan/zoom:
translate + scale.Keep pitch and bearing constant. Use a 3D engine such as Cesium for genuine changing pitch/bearing or a terrain flythrough.
const baseZoom = Math.max(start.zoom, end.zoom);
const map = new maptilersdk.Map({
container,
style,
center: end.center,
zoom: baseZoom,
pitch: end.pitch ?? 0,
bearing: end.bearing ?? 0,
interactive: false,
fadeDuration: 0,
canvasContextAttributes: {preserveDrawingBuffer: true},
});
// Per Remotion frame. `camera` is the approved centre/zoom interpolation.
const projected = map.project(camera.center);
const scale = 2 ** (camera.zoom - baseZoom);
const plate = {
transform: `translate(${width / 2 - projected.x * scale}px, ${height / 2 - projected.y * scale}px) scale(${scale})`,
transformOrigin: "0 0",
};
// Convert label projection with exactly the same plate transform.
const labelX = labelPoint.x * scale + width / 2 - projected.x * scale;
const labelY = labelPoint.y * scale + height / 2 - projected.y * scale;
1; otherwise the plate is being enlarged.MAX_RENDERBUFFER_SIZE.1.--gl=angle, preserveDrawingBuffer:true, and conservative concurrency (1) while validating.