Jegan
Jegan

Reputation: 139

Mapbox GL - Can we add animation while filtering layers

I would like to do some animation while filters are being applied on layers. For example, I have 2 layers with circles drawn of different radius on some geo points. While I switch from one layer to other layer by setting filters using setFilter(), I want the transition on circle opacity for a smooth transition.

Please assist

Upvotes: 2

Views: 1070

Answers (2)

Leana
Leana

Reputation: 9

Mapbox doesn't support this feature yet. see this issue

Upvotes: 0

kmandov
kmandov

Reputation: 3209

You can use circle-opacity to enable/disable layers. Set the opacity to 1 for active layers and to 0 for hidden layers.

I made a jsfiddle to illustrate this: https://jsfiddle.net/kmandov/kqey8y72/1/

Change the option from the select box to switch between the layers on the map.

Upvotes: 2

Related Questions