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: Location Provider overrides are reset when changing puck bearing value #2199

Open
jeffypooo opened this issue Jun 12, 2024 · 2 comments
Labels
bug 🪲 Something is broken! needs info SwiftUI Issues and features related to SwiftUI support.

Comments

@jeffypooo
Copy link

jeffypooo commented Jun 12, 2024

Environment

  • Xcode version: 15.4
  • iOS version: 17.5.1
  • Devices affected: All
  • Maps SDK Version: 11.4.0

Observed behavior and steps to reproduce

We use a state var to switch the Puck2D's bearing mode between nil and heading. We also use a custom LocationProvider/HeadingProvider, which we set during onAppear via the MapProxy, e.g. mapProxy.location!.override(provider: ourProvider). Our custom provider is a singleton instance.

When the puck bearing state variable is changed, we have to call LocationManager.override(provider:) again or it seems to reset to the default.

Expected behavior

We should only need to call LocationManager.override(provider:) once.

Notes / preliminary analysis

We can tell the provider is being reset because removeLocationObserver is being called when this puck bearing value is updated, and no subsequent call to addLocationObserver is received. We also change location accuracy filter settings on our provider when changing this puck bearing value, and those filters are not being respected unless we make another call to the override.

I am guessing this has to do with how the location manager handles the conversion from the provider to the Signal that it appears to use internally.

Additional links and references

Can provide a minimal example if needed.

@jeffypooo jeffypooo added the bug 🪲 Something is broken! label Jun 12, 2024
@persidskiy persidskiy added the SwiftUI Issues and features related to SwiftUI support. label Jun 12, 2024
@jeffypooo
Copy link
Author

@persidskiy anything I can do to get eyes on this?

@persidskiy
Copy link
Contributor

@jeffypooo Hi, can I ask you to get a minimal sample? That would definitely help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something is broken! needs info SwiftUI Issues and features related to SwiftUI support.
Projects
None yet
Development

No branches or pull requests

2 participants