For the complete documentation index, see llms.txt. This page is also available as Markdown.

Styling layers

Understanding layer styles

A layer's style is defined in a JSON-based format called the Felt Style Language, or FSL for short. Editors can view the current style of a layer inside a Felt map by clicking on Actions > Edit style language in a layer's overflow menu (three dots).

Here is an example of a simple visualization, expressed in FSL:

{
  "config": {"labelAttribute": ["type"]},
  "legend": {},
  "paint": {
    "color": "blue",
    "opacity": 0.9,
    "size": 30,
    "strokeColor": "auto",
    "strokeWidth": 1
  },
  "type": "simple",
  "version": "2.3.1"
}

Fetching a layer's current style

A layer's FSL can be retrieved by performing a simple GET request to a layer's endpoint — the response's style field contains the current style object:

Updating an existing layer's style

To update a layer's style, we can send a POST request with the new FSL to the same layer's /update_style endpoint.

FSL examples

You can find examples of FSL for different visualization types in the Felt Style Language section of these docs:

  • Simple visualizations: same color and size for all features (vector) or pixels (raster).

  • Categorical visualizations: different color per feature or pixel, based on a categorical attribute

  • Numeric visualizations: different color or size per feature or pixel, based on a numeric attribute.

  • Heatmaps: a density-based visualization style, for vector point layers.

  • H3: aggregate points into hexagonal bins.

  • Raster visualizations: imagery, single/multiband numeric, categorical, and hillshade styling for raster layers.

Last updated

Was this helpful?

Morty Proxy This is a proxified and sanitized view of the page, visit original site.