3

I'm playing around with data-driven styling in Mapbox GL JS. Setting the circle color based on a layer property works just fine:

"circle-color": { 'property': 'mag', 'stops': [ [4, "hsl(0, 100%, 50%)"], [8, "hsl(60, 100%, 50%)"] ] }

But when I try to set the circle radius by property and zoom like this:

"circle-radius": {
    'property': 'mag',
    'stops': [
        [{zoom: 4, value: 4}, 2],
        [{zoom: 4, value: 8}, 6],
        [{zoom: 12, value: 4}, 14],
        [{zoom: 12, value: 8}, 55]
     ]
 },

I get the following error:

Error: layers.earthquakes.paint.circle-radius.stops[0][0]: number expected, object found(…)   map.js:906 

Is this just a bug or am I doing something wrong?

  • I think mapbox watches Stackoverflow better, can you ask there? – Ralph Yozzo Aug 4 '16 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.