Configurable nav and non-nav location managers#856
Open
hactar wants to merge 5 commits intostadiamaps:mainfrom
Open
Configurable nav and non-nav location managers#856hactar wants to merge 5 commits intostadiamaps:mainfrom
hactar wants to merge 5 commits intostadiamaps:mainfrom
Conversation
Contributor
ianthetechie
left a comment
There was a problem hiding this comment.
In addition to the specific comment, I think that the environment approach would clean things up a lot and result in less code.
| self.onStyleLoaded = onStyleLoaded | ||
| userLayers = makeMapContent() | ||
| self.activity = activity | ||
| _navigatingLocationManager = State(initialValue: locationManagerConfiguration.navigatingLocationManager) |
Contributor
There was a problem hiding this comment.
This pattern is a bit confusing. You create an explicit state wrapper here with an initial value, but below on line 126 you're accessing the configuration property directly to get the non navigating location manager.
I'm not quite sure all the plumbing here is correct, basically.
Contributor
Author
There was a problem hiding this comment.
Good catch - I've changed the plumbing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR requires maplibre/swiftui-dsl#142 to actually work.
With our current set up it is difficult to achieve the following:
This PR addresses this by allowing you to specify which manager to use in which mode, and provides sane defaults when you don't: maplibre default when not navigating, ferrostar specific one when navigating.
Before change: (notice the current location puck not visible before navigating)
https://github.com/user-attachments/assets/9b784deb-bfe0-456a-8120-61dd3c613fc1
After change: (puck now visible before navigation)
https://github.com/user-attachments/assets/fe2f846a-e8aa-4844-9cb7-dc0cae796072