-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Content insets and more modifiers #28
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9bccf81
Fix unnecessary var binding
ianthetechie 875aff8
Fix runtime check warning about state change during update causing UB
ianthetechie c22d05d
Minor refactoring; introduce more snapshot tests to make things cleaner
ianthetechie ef10bbb
Support content insets and a few other idiomatic modifiers toward sup…
ianthetechie bcd90cf
Expose modifiers and MLNLocationManager instance publicly
ianthetechie e1b94ca
Merge branch 'main' into content-insets-and-more-modifiers + factor o…
ianthetechie e13f845
Minor fixes
ianthetechie 96919e4
Complete refactor of state-specific props out to the state
ianthetechie cb3af3f
Revert animated property to false
ianthetechie 3c084b3
First round of PR review fixes re: concurrency
ianthetechie 05c7af3
Break out map controls
ianthetechie b7f55bb
Add token snapshot test (though it doesn't work at the moment, like t…
ianthetechie 742622d
Minor refactoring; attempt to fix CI
ianthetechie 8635f1d
swiftfmt and bug fix
ianthetechie 1c321e6
Even worse hack to fix CI
ianthetechie 879bd06
PR fixes
ianthetechie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This file contains helpers that are used in the SwiftUI preview examples | ||
import CoreLocation | ||
|
||
let switzerland = CLLocationCoordinate2D(latitude: 47.03041, longitude: 8.29470) | ||
let demoTilesURL = | ||
URL(string: "https://demotiles.maplibre.org/style.json")! |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import CoreLocation | ||
import SwiftUI | ||
|
||
private let locationManager = StaticLocationManager(initialLocation: CLLocation( | ||
coordinate: switzerland, | ||
altitude: 0, | ||
horizontalAccuracy: 1, | ||
verticalAccuracy: 1, | ||
course: 8, | ||
speed: 28, | ||
timestamp: Date() | ||
)) | ||
|
||
#Preview("Track user location") { | ||
MapView( | ||
styleURL: demoTilesURL, | ||
camera: .constant(.trackUserLocation(zoom: 4, pitch: .fixed(45))), | ||
locationManager: locationManager | ||
) | ||
.mapViewContentInset(.init(top: 450, left: 0, bottom: 0, right: 0)) | ||
.ignoresSafeArea(.all) | ||
} | ||
|
||
#Preview("Track user location with Course") { | ||
MapView( | ||
styleURL: demoTilesURL, | ||
camera: .constant(.trackUserLocationWithCourse(zoom: 4, pitch: .fixed(45))), | ||
locationManager: locationManager | ||
) | ||
.mapViewContentInset(.init(top: 450, left: 0, bottom: 0, right: 0)) | ||
.hideCompassView() | ||
.ignoresSafeArea(.all) | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially controversial breaking change: I'm removing this since it's not that hard to do this yourself (just a few more characters). The annoyance of having to keep the convenience initializers in sync with the main one will get annoying over time, so I'm of a mind to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @hactar since I know you're a somewhat active user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - not using that one - and don't worry about me, I am aware that I am using a library at version 0.0.6, I'm expecting to be hit with a lot of breaking changes 😄