-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Deprecate some hardcoded mapbox styles, and replace those that remain with maplibre styles. (+docs!) #45
Merged
Merged
Deprecate some hardcoded mapbox styles, and replace those that remain with maplibre styles. (+docs!) #45
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
908f1a7
use maplibre style rather than mapbox style
michaelkirk 9c5b637
docs for NavigationViewController.init
michaelkirk 8ff89c1
Deprecate default style, instead pass in style URL
michaelkirk 7d907bf
add notes about broken/useless tests
michaelkirk 708832e
fixup! Deprecate default style, instead pass in style URL
michaelkirk 44f15c2
Revert "add notes about broken/useless tests"
michaelkirk 37e69c6
undo formatting
michaelkirk 945ddee
changelog entry
michaelkirk 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -34,28 +34,52 @@ open class Style: NSObject { | |
/** | ||
URL of the style to display on the map during turn-by-turn navigation. | ||
*/ | ||
@objc open var mapStyleURL: URL = MLNStyle.navigationGuidanceDayStyleURL | ||
@objc open var mapStyleURL: URL = MLNStyle.defaultStyle().url | ||
|
||
#if canImport(CarPlay) | ||
/** | ||
URL of the style to display on the map when previewing a route, for example on CarPlay. | ||
*/ | ||
@objc open var previewMapStyleURL = MLNStyle.navigationPreviewDayStyleURL | ||
@objc open var previewMapStyleURL = MLNStyle.defaultStyle().url | ||
#else | ||
/** | ||
URL of the style to display on the map when previewing a route. | ||
|
||
This property is currently unused by default, but you can use it to present your own route preview map. | ||
*/ | ||
@objc open var previewMapStyleURL = MLNStyle.navigationPreviewDayStyleURL | ||
@objc open var previewMapStyleURL = MLNStyle.defaultStyle().url | ||
#endif | ||
|
||
/** | ||
Applies the style for all changed properties. | ||
*/ | ||
@objc open func apply() {} | ||
|
||
@objc override public required init() {} | ||
|
||
@available(*, deprecated, message: "Use `init(mapStyleURL:)` to specify your map style. If you want to try the demo maplibre tiles, use init(demoStyle: ()).") | ||
@objc override public convenience init() { | ||
self.init(demoStyle: ()) | ||
} | ||
|
||
@objc public required init(mapStyleURL: URL) { | ||
self.mapStyleURL = mapStyleURL | ||
} | ||
|
||
@objc public convenience init(demoStyle: ()) { | ||
self.init(mapStyleURL: MLNStyle.defaultStyle().url) | ||
} | ||
} | ||
|
||
extension Style: NSCopying { | ||
public func copy(with zone: NSZone? = nil) -> Any { | ||
let copy = Self(mapStyleURL: self.mapStyleURL) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Living in Swift land for a while, I forgot about NSCopying! |
||
copy.tintColor = self.tintColor | ||
copy.statusBarStyle = self.statusBarStyle | ||
copy.fontFamily = self.fontFamily | ||
copy.styleType = self.styleType | ||
copy.mapStyleURL = self.mapStyleURL | ||
copy.previewMapStyleURL = self.previewMapStyleURL | ||
return copy | ||
} | ||
} | ||
|
||
/** | ||
|
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.
The demo styles are now being used in some places that were previously defaulting to mapbox styles. This is probably wrong, but (I think) no worse than things being completely broken before.
Probably these should somehow be surfaced or inferred as well. I somewhat arbitrarily decided this was out of scope for this PR, but I could follow up in this PR or another depending on how people are feeling about it.
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.
I personally don't mind your approach here 👍