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

Course view slides around when switching to overview #1505

Closed
1ec5 opened this issue Jun 18, 2018 · 0 comments
Closed

Course view slides around when switching to overview #1505

1ec5 opened this issue Jun 18, 2018 · 0 comments
Labels
bug Something isn’t working topic: location

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jun 18, 2018

When the user taps the Overview button, the course view slides around quite noticeably. It doesn’t settle into the correct position on screen until after the map view’s camera animates to completion. This sliding effect destroys the visual illusion of the course view being “stuck to” a geographic location on the map.

NavigationMapView.setOverheadCameraView(from:along:for:) zooms out here using MGLMapView’s built-in camera animation functionality:

setVisibleCoordinateBounds(line.overlayBounds, edgePadding: bounds, animated: true)

Most likely, this method should also set a flag that causes RouteMapViewController’s implementation of NavigationMapViewDelegate.mapViewRegionIsChanging(_:) to update the course view’s position without animation, similar to this code that runs whenever the location changes:

UIView.animate(withDuration: duration, delay: 0, options: [.curveLinear, .beginFromCurrentState], animations: {
self.userCourseView?.center = self.convert(location.coordinate, toPointTo: self)
}, completion: nil)

(It’s a little unfortunate that the course view is laid out in NavigationMapView itself but has to be synchronized by the map view’s delegate. One solution would be to move the course view functionality into RouteMapViewController. Another would be for MGLMapView to expose the internal method that calls MGLMapViewDelegate.mapViewRegionIsChanging(_:).)

This issue has been present probably since we converted the course view from a view-backed annotation to a manually synchronized view in #402. The issue doesn’t affect the Android navigation SDK, which implements the course view as a feature in a GeoJSON source.

/cc @mapbox/navigation-ios

@1ec5 1ec5 added bug Something isn’t working topic: location labels Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working topic: location
Projects
None yet
Development

No branches or pull requests

1 participant