I would like layer setup in CARTO - scaling map for certain layers.

How do I change the zoom, for example, on map markers, so that they are not displayed at all scales?


It looks like you want to use Conditional CartoCSS to style your markers or other features on your map.

To do so inside CARTO Builder:

  1. Click on the layer you want to style and switch to the STYLE tab.
  2. On the bottom, click on the slider to switch to the CartoCSS console.
  3. Apply a condition on the zoom value.

For example,

#layer {
  [zoom > 5] {
    marker-width: 20;
    marker-fill: #FF0000
  [zoom > 10] {
    marker-width: 40;
    marker-fill: #00FF00

would style points in red and with size 20 for zoom levels higher than 5, and in green and size 40 for zoom levels higher than 10. The points would be invisible for zoom levels equal to or smaller than 5.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.