Advanced styling (FSL)
Edit layer styles as JSON with Felt Style Language (FSL). Use MapLibre overrides for bivariate styles, combined labels, and more.
Felt Style Language (FSL) stores layer styles as JSON. The style editor generates the JSON, which you can edit directly in the style language editor. For the full list of FSL properties, see the FSL developer docs.
Open the style language editor
Click Edit map to enter edit mode.
In the legend, open the layer's ··· menu and click Actions > Edit style language. The style language editor opens, showing the layer's FSL.
Changes in the style editor appear in the FSL right away, and FSL edits update the style editor and the map. The REST API and the JavaScript SDK also read and write styles as FSL. See REST API.

Write FSL by hand
An FSL style specifies a visualization type. Its config block names the attributes the style uses. This example uses the land_use attribute to give each category of polygons its own color and labels each polygon with its name.
config.labelAttributeturns labels on and chooses the attribute they show. Thelabelblock controls only their appearance.paint.colorlists one color for each value incategories, in the same order. WithshowOtherset totrue, add one more color for the other values.
MapLibre style overrides
A MapLibre style override passes a raw MapLibre style property to a layer in FSL. Felt draws maps with MapLibre, so MapLibre paint and layout properties work. Use overrides for effects the style editor doesn't offer, such as bivariate maps or colors taken from an attribute.
Open the style language editor. See Open the style language editor.
In the
paintblock, or thelabelblock for labels, add apaintPropertyOverridesobject.Add the MapLibre property and its value.
Property names must match MapLibre's specification exactly. Felt ignores invalid properties without showing an error. An override replaces the value FSL generates, but the legend doesn't reflect it, so add a caption to explain it. See Legend.
Color based on an attribute
A fill-color override can color each polygon with a color stored in its data, such as a color attribute holding #FF5733:
Bivariate styling
A bivariate map shows two variables at once. In this example, a Categories style colors points by continent. A circle-radius override sizes them by population, from 8 px at 71,801,000 to 40 px at 1,463,870,000:
Combine attributes in a label
A text-field override in the label block builds a label from several attributes, adds text such as "$" or " feet", or splits a label across lines with \n. A label set with Label by already uses the attribute's number format, so you need an override only to combine attributes, add text, or split a label.
concatjoins attributes, text, and line breaks.["get", "name"]reads an attribute by its exact name.number-formatformats a number. Because the override ignores the attribute's number format, wrap numbers innumber-formatto add thousands separators. Usenumber-format, notto-string, which returns the digits with no separators.
Text and a formatted number
This label puts a product category on the first line and a revenue value, with a dollar sign and no decimals, on the second.
Use { "max-fraction-digits": 0 } to drop decimals, or { "min-fraction-digits": 2, "max-fraction-digits": 2 } to always show two.

Several text attributes
To join text attributes, such as an address on one line and the city and state on the next, use concat alone:

A percentage
number-format has no percent option, so multiply the value by 100 and add "%". A rate of 0.873 shows as 87.3%. For a label with one attribute, the attribute's Percent format does this for you.
Don't wrap identifiers such as ZIP codes or years in number-format: it adds separators, giving you values such as 2,024. For currency, locale, and other options, see MapLibre's number-format reference. If currency doesn't show on your map, add "$" as text instead.

Show every label
Felt hides labels that would overlap. To show every label anyway, open the layer's style language editor and add this object to the label block, next to the other properties:
Overlapping labels can be hard to read, so check the map at several zoom levels. Labels outside the layer's Labels range stay hidden. See Labels.
Frequently asked questions
Last updated
Was this helpful?