Skip to content

Add cartographic styles to data using 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.

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

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

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

Section titled “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

Section titled “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.

6. Add your new CartoCSS style in the right pane

Section titled “6. Add your new CartoCSS style in the right pane”

Changes will be previewed in the left pane.

The new style isn’t available to users yet.

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.

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.

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.

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.

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