You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
expose property transitions to platform SDKs #6779
mbgl does support paint property transitions baked into the style. However, as far as I can tell, the concrete mbgl::style::Layer classes don’t support transitions as part of runtime styling. (They also doesn’t support setting properties per style class: #5948.)
Also, mbgl does support setting a global paint property duration and delay, via mbgl::Map::setTransitionOptions(). However, in the iOS and macOS SDKs, -[MGLStyle setStyleClasses:transitionDuration:] is currently private; its only caller is -[MGLStyle setStyleClasses:].
I've done some experiments with this using the approach outlined here (under Animating Non-Visual Properties), which leverages CALayer's ability to interpolate various types of values (numbers, colors, etc.) and, within a CABasicAnimation, repeatedly sets them in the runtime styling API through the use of the presentationLayer values.
This isn't high priority right now, but I will get back to this in the near future.
Similarly, @cammace was able to do something a lot like this on Android using ValueAnimator in the demo app. We could probably build out similar APIs on both platforms using the built-in animators of each.
Instead, I'm working on global/per-map setters & getters that can be used for broad style URL changes as well as runtime styling. I've confirmed that such things work when set globally (so, you could set a global duration of five seconds, then change a runtime styling property and see it animate in over that duration).
Activity
1ec5 commentedon Oct 21, 2016
mbgl does support paint property transitions baked into the style. However, as far as I can tell, the concrete
mbgl::style::Layerclasses don’t support transitions as part of runtime styling. (They also doesn’t support setting properties per style class: #5948.)1ec5 commentedon Oct 21, 2016
Also, mbgl does support setting a global paint property duration and delay, via
mbgl::Map::setTransitionOptions(). However, in the iOS and macOS SDKs,-[MGLStyle setStyleClasses:transitionDuration:]is currently private; its only caller is-[MGLStyle setStyleClasses:].incanus commentedon Nov 1, 2016
I've done some experiments with this using the approach outlined here (under Animating Non-Visual Properties), which leverages
CALayer's ability to interpolate various types of values (numbers, colors, etc.) and, within aCABasicAnimation, repeatedly sets them in the runtime styling API through the use of thepresentationLayervalues.This isn't high priority right now, but I will get back to this in the near future.
incanus commentedon Nov 1, 2016
Similarly, @cammace was able to do something a lot like this on Android using
ValueAnimatorin the demo app. We could probably build out similar APIs on both platforms using the built-in animators of each.incanus commentedon Jan 13, 2017
Re: #6779 (comment), I'm going to sidestep anything related to style classes right now due to #5948 (comment).
Instead, I'm working on global/per-map setters & getters that can be used for broad style URL changes as well as runtime styling. I've confirmed that such things work when set globally (so, you could set a global duration of five seconds, then change a runtime styling property and see it animate in over that duration).
refs #6779: first cut of iOS transition options
refs #6779: mobile & Mac SDK style transition options (#7711)