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.

Defer asking for user location annotation view until delegate is set #9781

Closed

Description

@1ec5

If an application sets the “Shows User Location” inspectable but sets MGLMapView.delegate in a -viewDidLoad method, -[MGLMapViewDelegate mapView:viewForAnnotation:] is never called for the userLocation annotation. -[MGLMapView setShowsUserLocation:] is currently responsible for calling -[MGLMapViewDelegate mapView:viewForAnnotation:] based on delegate being set, so the application ends up having to unset and reset showsUserLocation after setting delegate in order for -[MGLMapViewDelegate mapView:viewForAnnotation:] to be called.

-[MGLMapViewDelegate mapView:viewForAnnotation:] should also be called when delegate is set. Alternatively, it should only be called lazily when the annotation view is first needed. This would be a good opportunity to audit MGLMapView for any other code that should run when setting the delegate.

/ref #9357 mapbox/mapbox-navigation-ios#498 (comment)
/cc @friedbunny @bsudekum

Activity

  1. added
    annotations
    iOS
    on Aug 16, 2017
  2. added
    archived
    on Nov 5, 2018
  3. stale commented on Dec 1, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  4. removed
    archived
    on Dec 2, 2018
  5. added
    archived
    on May 31, 2019
  6. stale commented on May 31, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  7. removed
    archived
    on Jun 3, 2019
  8. added
    archived
    on Nov 30, 2019
  9. stale commented on Dec 1, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

    annotationsarchivedbugiOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions