Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paulovieira opened this issue Apr 8, 2025 · 0 comments

Comments

@paulovieira
Copy link

paulovieira commented Apr 8, 2025

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
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants