Skip to main content

Integer zoom for symbol layout

Shared symbol layout evaluates at floor(zoom); paint evaluates at current fractional zoom. Layout uses4 from4.1 through4.9 and changes to5 at5.0. Returning to4.9 restores layout4. This follows the official MapLibre camera-expression rule.

map.setLayoutProperty('icons','icon-size',
 ['interpolate',['linear'],['zoom'],4,1,5,2]);
map.setPaintProperty('icons','icon-opacity',
 ['step',['zoom'],0,4.5,1]);
map.setZoom(4.6);
await map.sqs.flush({render:true});
// Layout size is 1; paint opacity is 1.

This covers connected icon/text size, rotation, offset, anchor, text field/case/typography and collision/padding/optional/sort expressions. Visible missing-image demand uses the same layout level. Paint color/opacity remains fractional. Source, global-state, image and glyph changes still refresh immediately without waiting for the next integer zoom.

This rule applies to layout evaluation. Actual camera zoom, source filtering/clustering, layer minzoom/maxzoom and other domains retain their own semantics. Queries use actual placed footprints; getLayoutProperty retains original expressions. Independent URL basemaps use their compiler. Supported expression forms and other property bounds remain documented in each guide.

The portable script passes seven identical actual native QuickJS/browser main-thread/Worker assertions and red-icon pixel checks. Device/formal-release acceptance remains separate.