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
As of v10.0.0-rc.3, CameraAnimationsManager.fly(to:duration:completion:) and ease(to:duration:curve:completion:) unconditionally create and start animators, even if the target camera is literally or practically identical to the current camera. An application may chain many of these calls together, for example to follow the user’s location. But if the user doesn’t move, these chained animation calls end up wasting power to animate an otherwise still map.
These methods should compare the original and target cameras and avoid starting the animator if there isn’t an appreciable difference between the two cameras. At a glance, I don’t think it would be necessary to perform the same check for the raw makeAnimator(…) methods, because the client code probably expects to have to do more coordination around the animation and may have more sophisticated logic for debouncing animations, especially concurrent animations.
At a glance, I don’t think it would be necessary to perform the same check for the raw makeAnimator(…) methods, because the client code probably expects to have to do more coordination around the animation and may have more sophisticated logic for debouncing animations, especially concurrent animations.
As a case in point, the navigation SDK makes animators directly, so mapbox/mapbox-navigation-ios#3152 tracks adding debouncing logic there.
These methods should compare the original and target cameras and avoid starting the animator if there isn’t an appreciable difference between the two cameras.
@1ec5, what do you think an "appreciable difference" constitutes?
As of v10.0.0-rc.3,
CameraAnimationsManager.fly(to:duration:completion:)
andease(to:duration:curve:completion:)
unconditionally create and start animators, even if the target camera is literally or practically identical to the current camera. An application may chain many of these calls together, for example to follow the user’s location. But if the user doesn’t move, these chained animation calls end up wasting power to animate an otherwise still map.These methods should compare the original and target cameras and avoid starting the animator if there isn’t an appreciable difference between the two cameras. At a glance, I don’t think it would be necessary to perform the same check for the raw
makeAnimator(…)
methods, because the client code probably expects to have to do more coordination around the animation and may have more sophisticated logic for debouncing animations, especially concurrent animations.mapbox-maps-ios/Sources/MapboxMaps/Foundation/Camera/CameraAnimationsManager.swift
Line 107 in cde8041
mapbox-maps-ios/Sources/MapboxMaps/Foundation/Camera/CameraAnimationsManager.swift
Line 145 in cde8041
For reference, mapbox/mapbox-gl-native#7125 was the first of a few PRs that implemented camera debouncing in the previous iOS/macOS map SDK.
/cc @mapbox/maps-ios @MaximAlien
The text was updated successfully, but these errors were encountered: