Skip to content

Course view slides around when switching to overview #1505

Closed

Description

@1ec5

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

Activity

  1. added
    bug
    on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtopic: location

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions