Reputation: 4850
I'd like to style points on my map as follows:
'circle-radius': {
property: 'pixelRadius',
stops: [
[0, 0],
[20, 'pixelRadius'],
],
base: 2,
}
The use case is similar to Drawing a circle with the radius in miles/meters with Mapbox GL JS
Except that in my properties
map I have computed the pixel radius so that each point in the FeatureCollection has its own radius.
Can this be done? All of the examples Ive seen with stops
have a hard coded value for the 2nd array element.
Upvotes: 0
Views: 1486
Reputation: 1125
Try this:
'circle-radius': [
"interpolate",
["exponential", 2],
["zoom"],
0, 0,
20, ['get', 'pixelRadius']
],
So here it is using expression (https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-get) instead of function.
Upvotes: 2