Skip to content

Style data with CartoCSS

CartoCSS is a syntax that lets you add styles to geospatial data layers, customising the appearance of your data. In this guide, we introduce how to add CartoCSS to a layer, and provide some tips for using CartoCSS on Koordinates. Further documentation, including a list of CartoCSS properties, is available in the cartography editor.

The Map Styles tab is available to users who can manage service permissions on a site (Team Cloud Plan, Business Cloud Plan, Enterprise). You can style layers and sets.

  1. Find and open your layer or set

    Select Manage from the top menu, then find the layer or set in the Datasets tab and select it.

  2. Select the ‘Map Styles’ tab

    A layer’s Map Styles tab, listing its styles with a New Map Style button

  3. Select ‘New Map Style’

    Map Style list with the Auto-generated preview style as the default, and an arrow pointing to the New Map Style button.

  4. Add a name for your style and select ‘Save’

    The new style is added to the list of map styles.

  5. Select ‘Edit Style’ to open the cartography editor

    Hover over the style and select Edit Style, or open the style’s … menu and select Edit style cartography. The editor opens in a new window.

    Map Style list with a new draft style called My Custom App Style, and an arrow pointing to the Edit Style button beside Publish.

  6. Add your new CartoCSS style in the right pane

    Changes will be previewed in the left pane.

    CartoCSS editor with a map preview on the left and a style.mss file on the right, with Save and Cancel buttons.

  7. Save and close the editor

    The new style isn’t available to users yet.

  8. Publish the style

    Hover over the style and select Publish, or open the style’s … menu and select Publish style.

    This starts generating the style’s map tiles, shown by a loading spinner. Once it’s finished, the style appears in the thumbnail preview and is marked PUBLISHED.

    Map Style list with My Custom App Style marked Published.

To change the default style for a layer, open the style’s … menu and select Make default style. You can only make a published style the default. Changing the default style publishes a new version of your layer. If the layer has a draft, you’ll need to publish the draft to make the new default style live.

To remove a style, open its … menu and select Delete style.

Map Style list with the three-dot menu open on a published style, offering Make default style, Edit style cartography, Publish style and Delete style.

The process is the same as creating new styles for a layer. Open the set’s Map Styles tab and follow the instructions above.

Note that the top layer in your CartoCSS style definition will be the bottom layer when drawn in the map. For example, if layer 7328 is listed above layer 7344 in your style definition, layer 7328 is drawn below layer 7344.

You can find a range of supported fonts by selecting the A at the bottom left of the cartography editor.

CartoCSS editor with an arrow pointing to the label button on the left toolbar.

Access reference documentation on CartoCSS styling

Section titled “Access reference documentation on CartoCSS styling”

You can find reference documentation on available style attributes and syntax by selecting the curly brackets at the bottom left of the cartography editor.

CartoCSS editor with an arrow pointing to the curly brackets button on the left toolbar.

To choose between map styles and the Appearance panel in the map viewer, see Style a layer.