This content applies to a previous version of CARTO
In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com
How can I style a Builder layer based on the zoom level?
Overview
Zoom-based styling enables you to modify what appears on a map or how it displays based on zoom-level changes. As users zoom in or out, entire layers or individual features can adjust their visual representation. This effect is achieved through CartoCSS zoom-based styling.
Syntax
When CartoCSS properties are enclosed in brackets [zoom] { }, zoom-based styling activates when the map reaches the specified zoom level. The square brackets denote zoom-based styling, while curly brackets contain the styling rules to apply.
Example
[zoom = 4] {marker-width: 6}
This example demonstrates that marker size increases when zoom level 4 is reached. The syntax structure allows you to define precisely when and how your data appears on the map based on zoom conditions.
