Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add delegate method for the user location annotation’s position #12203

Closed

Description

@1ec5

#11342 proposes adding two new values to the MGLAnnotationVerticalAlignment enumeration that fall between existing values. The existing values clearly aren’t granular enough, but I don’t think we can keep adding new values to accommodate specific applications. Instead, we should add a method to MGLMapViewDelegate that lets the developer decide where the annotation view should be positioned on screen (and thus where the camera’s center coordinate is positioned on screen). This delegate method would be modeled after NavigationViewControllerDelegate.navigationViewController(_:mapViewUserAnchorPoint:), which we introduced in mapbox/mapbox-navigation-ios#402.

/ref #7716 #12147
/cc @frederoni @julianrex

Activity

  1. added
    iOS
    navigation
    annotations
    on Jun 22, 2018
  2. 1ec5 commented on Jun 22, 2018

    @1ec5
    ContributorAuthor

    The new delegate method would be called from within -userLocationAnnotationViewCenter. We could alternatively expose -userLocationAnnotationViewCenter publicly, but I think that could be problematic for developers who can’t subclass MGLMapView for whatever reason.

  3. 1ec5 commented on Jul 2, 2018

    @1ec5
    ContributorAuthor

    Unlike the instance method proposed in #6867, the delegate method proposed here would require no subclassing.

  4. 1ec5 commented on Sep 14, 2018

    @1ec5
    ContributorAuthor

    This issue blocks the navigation SDK from readopting the map SDK’s user location annotation functionality. Fortunately, it may be straightforward to upstream the navigation SDK’s approach to customizing the position. As part of implementing this feature, we’d probably want to deprecate the existing MGLAnnotationVerticalAlignment enumeration, which we now recognize is far too simplistic for navigation use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

annotationsiOSnavigation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions