Wykks / ngx-mapbox-gl

Angular binding of mapbox-gl-js
https://wykks.github.io/ngx-mapbox-gl
MIT License
344 stars 138 forks source link

Draw mgl-circle using data-driven meters value #188

Closed ghost closed 4 years ago

ghost commented 4 years ago

I am going to draw data-driven meters circle using mgl-radius. <mgl-layer id="trade-circle" type="circle" source="tradecircles-source" [paint]="{ 'circle-radius': { stops: [ [0, 0], [20, ['get', 'radius']] ], base: 2 }, 'circle-color': '#00ff00', 'circle-stroke-color': ['get', 'circle-stroke-color'], 'circle-stroke-width': 2 }"

but got this error.

mapbox-gl.js:29 Error: layers.trade-circle.paint.circle-radius.stops[1][1]: expressions are not allowed in function stops.

dmytro-gokun commented 4 years ago

The error code is pretty clear: "expressions are not allowed in function stops.". You need to consult mapbox-gl-js documentation about that. May be you just need to reference a newer version of mapbox-gl-js which does support expressions in function stops (if such version exists).

NB. I think, https://github.com/mapbox/mapbox-gl-js would be a proper place to ask this question. Or, even better, stackoverflow.