Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwiftUI - Override location provider Puck refresh rate #2293

Open
nicolasbarb opened this issue Feb 18, 2025 · 0 comments
Open

SwiftUI - Override location provider Puck refresh rate #2293

nicolasbarb opened this issue Feb 18, 2025 · 0 comments
Labels
bug 🪲 Something is broken!

Comments

@nicolasbarb
Copy link

Environment

  • Xcode version: 15.4
  • iOS version: 17.5 > 18.3.1
  • Devices affected: all physicals + simulators
  • Maps SDK Version: 11.10

Observed behavior and steps to reproduce

According Mapbox SwiftUI docs, i transform to a Signal my locations and override LocationProvider
proxy.location?.override(locationProvider: mapLocationSignal())

Using basic puck 2D configuration
Puck2D(bearing: .heading)

And Viewport as "Follow Puck"
.followPuck(zoom: MapConstants.Settings.DEFAULT_ZOOM)

Puck refresh is not fluid at all, my locations are refreshed every 0.05 seconds and puck should be animated from previous location to new location thanks to interpolation.

ScreenRecording_02-18-2025.14-59-34_1.mov

Expected behavior

I expect my puck refresh to be as smooth as my old integration using UIKit system with UIViewRepresentable.
As seen in the video the puck is very smooth and satisfying even at maximal zoom.

ScreenRecording_02-18-2025.14-55-14_1.mov

Notes / preliminary analysis

i started thinking it was a viewport bug but removing it clearly show that there is a bug in disappearing / appearing puck logic.
I tried to log PuckRenderingData which are the interpolated values between 2 locations.
Heres a sample where "loc" are real locations and "puck" the interpolated one
📍loc latitude: 45.74135119298924 📍 Puck latitude: 45.74133870265051 📍 Puck latitude: 45.741338892579 📍 Puck latitude: 45.741339083179604 📍 loc latitude: 45.74135119298924

I can clearly see that interpolation is working but nothings pretty on screen.

Also test with AppleLocationProvider implementation with and without overriding, it's better but i can still see some latency in puck refresh.

Is there anything I'm forgetting ?

@nicolasbarb nicolasbarb added the bug 🪲 Something is broken! label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something is broken!
Projects
None yet
Development

No branches or pull requests

1 participant