-
Notifications
You must be signed in to change notification settings - Fork 156
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
Example for navigation simulation #1328
Conversation
Apps/Examples/Examples/All Examples/NavigationSimulatorExample.swift
Outdated
Show resolved
Hide resolved
a3cf04e
to
ca4ba2c
Compare
init(mapView: MapView, route: LineString) { | ||
self.viewport = mapView.viewport |
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.
Should we use Viewport
as an argument here as we are not using mapView anymore?
mapView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), | ||
mapView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor), | ||
mapView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor), | ||
mapView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor), |
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.
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.
interesting, we should actually constraint or bind the map to the safe area and not the whole view controller, since it is configured for its contents to be extended under the navigation bar -> we can't see the top of the map as Andrew pointed out here #1225 (comment)
I think the way navigation bar looks like that when view is constrained to navigation bar is because of the way we configure UINavigationBarAppearance
for iOS 13+
this snippet fixed the problem though, wdyt?
if #available(iOS 13.0, *) {
let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithOpaqueBackground()
appearance.scrollEdgeAppearance = navigationBarAppearance
appearance.compactAppearance = navigationBarAppearance
appearance.standardAppearance = navigationBarAppearance
}
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 think extending the map under the bars and making it fill the whole screen makes it looks like it belongs on iOS(the map is visible under the translucent bars). I checked how apple handles this in their Maps app, they use the globe view on lower zoom levels that eliminates this issue. Google Maps seems to both use opaque bars and have a part of the map behind them(obstructing a portion of the map behind them, of course).
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.
Apps/Examples/Examples/All Examples/NavigationSimulatorExample.swift
Outdated
Show resolved
Hide resolved
Exp(.product) { | ||
7.0 | ||
1.0 | ||
} |
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'm not quite sure if I understand this correctly, but shouldn't it translate to something like 7.0 * 1.0
- given that .product
- "Returns the product of the inputs"?
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.
yes, I think explicitly putting one here is for the sake of readiblity in its string representation :-D we could instead do Exp(.literal) { value }
but I think we should keep this to make it consistent with Android.
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 see, having a column of just numbers, indeed, will make it hard to visually parse. However this more verbose notation seems to be a bit superfluous.
I wonder would it make it more readable if zoom level and raw line width value would be grouped on a single line, creating sort of a switch
statement:
casingLayer.lineWidth = .expression(
Exp(.interpolate) {
Exp(.exponential) {
1.5
}
Exp(.zoom)
10.0; 7.0
14.0; 10.5
16.5; 15.5
19.0; 24.0
22.0; 29.0
}
)
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 too think the syntax of iOS Expression
could be improved. At the moment it can take up too many lines of code and provide little readability :-D would be nice to have a team discussion on this and propose new or addition way for Expression.
Co-authored-by: Roman Laitarenko <roman.laitarenko@mapbox.com>
844c214
to
07206ff
Compare
* Add jazzy-theme as a submodule * Correct working directory for build-docs * Point studio preview Podfile to the internal repo * Top-level podspec * Private Github token for api compatibility check * Fix paths in generate-maps-docs * Install python dependencies for create-draft-release * Fix path in create-github-draft-release * Remove extranneous release-precheck requirement * Use local maps sdk to validate studio preview
* Add jazzy-theme as a submodule * Correct working directory for build-docs * Point studio preview Podfile to the internal repo * Top-level podspec * Private Github token for api compatibility check * Fix paths in generate-maps-docs * Install python dependencies for create-draft-release * Fix path in create-github-draft-release * Remove extranneous release-precheck requirement * Use local maps sdk to validate studio preview
* Add jazzy-theme as a submodule * Correct working directory for build-docs * Point studio preview Podfile to the internal repo * Top-level podspec * Private Github token for api compatibility check * Fix paths in generate-maps-docs * Install python dependencies for create-draft-release * Fix path in create-github-draft-release * Remove extranneous release-precheck requirement * Use local maps sdk to validate studio preview
MAPSIOS-167 Create a simulation for a navigation with vanishing routes effect.
Simulator.Screen.Recording.-.iPhone.13.mini.-.2022-06-13.at.15.05.32.mp4
Please note that there is something in progress calculation of Turf so it seems that the progress goes ahead of the movement, this also happens on Android. We will be looking into this separately.
Pull request checklist:
## main
heading near the top).