ui-mapbox
ui-mapbox copied to clipboard
Update 'paint' option of added Layer?
I'm looking for a way to update the circle-radius
(inside paint
) of already created Layer.
I can't seem to find any API for that and no examples either.
Is the only way currently to do so is to delete the old layer and create a new layer?
Thanks.
Currently that is your only option. I'll add that possibility soon, as it's a minor addition but a very useful one.
Hi @butaminas
I've just opened a new PR #42 that makes it possible to set and get the layer properties.
After the PR is merged, you can set the 'circle-radius' property like below:
const layer = await this.mapbox.getLayer('myCircleLayer');
layer.setProperty('circle-radius', ['get', 'radius']);