mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Rotation animation incredibly jerky after updating SDK

Open ibmeister opened this issue 3 years ago • 11 comments

Environment

  • Xcode version: 13.4
  • iOS version: 14.5
  • Devices affected: iPhone 11 Pro Max
  • Maps SDK Version: 10.6.1

Observed behavior and steps to reproduce

Code snippet:

let bearingAnimator = mapView.camera.makeAnimator(
                duration: 250,
                curve: .linear
            ) { (transition) in
                transition.shouldOptimizeBearingPath = false
                transition.bearing.toValue = -3600
            }
            
bearingAnimator.startAnimation(afterDelay: 0.2)

Jerky rotation animation from Mapbox SDK 10.6.1

https://user-images.githubusercontent.com/11130748/181098610-b39979e3-387a-482f-822c-5c4459079afc.mov

Expected behavior

Smooth rotation animation from Mapbox SDK 10.2 with the same code

https://user-images.githubusercontent.com/11130748/181098806-f171b038-7968-4db5-a1eb-76c5989f5705.MP4

Notes / preliminary analysis

Additional links and references

ibmeister avatar Jul 26 '22 19:07 ibmeister

@ibmeister thank you for reporting. I am currently unable to reproduce this behavior you're reporting. To better assist you, can you please provide us with the following:

  • For the objects aside from your location puck, what types of objects/layers are you using to add these? Are they 3D models? Additionally, how many are you adding to the map at one time?
  • Can you please provide a minimal test case / sample app that reproduces this behavior?

ZiZasaurus avatar Jul 27 '22 15:07 ZiZasaurus

Hi @ZiZasaurus. Thanks for following up.

  • No they are not 3d models, they are 2D images and are only about 10kb with the assets reused
  • Unfortunately our code base is fairly large but could add you as a temporary contributor if that's an option.

I noticed this problem across the board with the Camera Animator in the latest Mapbox SDK. Transitions seem to be jerky and not working as they used to. Here's another issue I experienced https://github.com/mapbox/mapbox-maps-ios/issues/1170#issuecomment-1057623418. The issue still persists but I had to work around it using flyTo and easeTo which don't seem to have the problem.

I don't think this makes a difference but also worth mentioning that we are using SwiftUI. The Mapbox view is wrapped as a UIViewRepresentable

ibmeister avatar Jul 27 '22 16:07 ibmeister

@ZiZasaurus anything more you need from me that could help us make progress with this?

ibmeister avatar Jul 29 '22 16:07 ibmeister

@ibmeister thank you for following up. If adding me as a temporary contributor is possible it would be great to see the implementation.

ZiZasaurus avatar Jul 30 '22 01:07 ZiZasaurus

@ZiZasaurus thanks! Added you. Let me know if you have any issues running it. There is a Mapbox.xcconfig file required to define environment variables MAPBOX_ACCESS_TOKEN and MAPBOX_STYLESHEET in order to properly render the map. If needed, let me know the best way to deliver this to you

ibmeister avatar Jul 31 '22 05:07 ibmeister

The main branch's Mapbox SDK is pegged to 10.2. All you have to do to reproduce the issue is update it to the latest version. Also happy to walk through the code anytime.

ibmeister avatar Jul 31 '22 05:07 ibmeister

@ZiZasaurus just following up :)

ibmeister avatar Aug 05 '22 01:08 ibmeister

Hi @ibmeister thank you for following up. How do I access your code base?

ZiZasaurus avatar Aug 18 '22 13:08 ZiZasaurus

@ZiZasaurus I added you as a contributor via github. You should have gotten a notification. Here's a link to it: https://github.com/Dropverse/Dropverse. Feel free to also reach out to me via email if you have any difficulty accessing it: [email protected]

ibmeister avatar Aug 19 '22 04:08 ibmeister

@ZiZasaurus Same issue: "jerky" rotation animation running 10.7. After reverting to 10.2 the rotation is smooth as butter. No 3D models. I have some complex map layers, but those are part of the style. Adding almost nothing new at runtime.

Tapestes avatar Sep 01 '22 19:09 Tapestes

Thank you both for your patience. I'm not experiencing this behavior on our newest version of the SDK, v10.9.0-beta.1. I have attached a video of my implementation that uses your code below.

https://user-images.githubusercontent.com/44972592/191660778-2d60881c-4c6e-4f2a-965e-940c606163fa.mov

ZiZasaurus avatar Sep 22 '22 04:09 ZiZasaurus

Closing ticket but please feel free to reopen if you're still experiencing this issue.

ZiZasaurus avatar Nov 11 '22 16:11 ZiZasaurus