Skip to content

docs: the "Style circles with a data-driven property" example is using legacy syntax #13451

@paulovieira

Description

@paulovieira

The following example is often on the top results when searching for Mapbox GL JS examples:

"Style circles with a data-driven property"
https://docs.mapbox.com/mapbox-gl-js/example/data-driven-circle-colors/

It seems that the "circle-radius" property is still using a legacy "function" syntax, which is confusing for newcomers as expressions always use arrays:

https://docs.mapbox.com/style-spec/reference/other/#function

Instead of

'circle-radius': {
    'base': 1.75,
    'stops': [
        [12, 2],
        [22, 180]
    ]
}

it should be

'circle-radius': [
	'interpolate',
	['exponential', 1.75],
	['zoom'],
	12, 2,
	22, 180
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions