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.

MGLMapView calls MGLMapViewDelegate 'viewForAnnotation:' for annotations outside visible area #6173

Closed

Description

@1uss1

Platform: iOS
Mapbox SDK version: 3.3.4

Steps to trigger behavior

  1. Build & run Mapbox iOS example app located at 'platform/ios/ios.xcodeproj'
  2. Click 'gear' icon on top left corner to open Map Settings menu
  3. Click 'Add 100 Views' to add annotations to map
  4. Pan map so annotations are outside the visible map area.
  5. Keep panning into areas with no annotations

Expected behavior

No annotations are visible on the map or nowhere near the borders of visible area, MGLMapView should not(?) call method:
**'- (MGLAnnotationView )mapView:(MGLMapView )mapView viewForAnnotation:(id)annotation'

Why? Because there's no annotations visible.

Actual behavior

**'- (MGLAnnotationView )mapView:(MGLMapView )mapView viewForAnnotation:(id)annotation' is called constantly while panning on the map while there are no annotations nowhere near the visible area.

Below is the callstack.

screen shot 2016-08-26 at 16 59 07

In a nutshell 'MGLMapView notifyMapChange:' method is called with param MapChangeDidFinishRenderingFrameFullyRendered which triggers a update for all annotations(?)

Why is this a problem?

The map becomes very unresponsive with large amount of MGLAnnotationView objects placed on the map. I feel like the annotation view reuse queue is not working like it is intended to work.

Activity

  1. changed the title [-]MGLMapViewDelegate calls viewForAnnotation: for annotations outside visible area[/-] [+]MGLMapView calls MGLMapViewDelegate 'viewForAnnotation:' for annotations outside visible area[/+] on Aug 26, 2016
  2. 1ec5 commented on Aug 26, 2016

    @1ec5
    Contributor
  3. added
    iOS
    performance
    annotations
    on Aug 26, 2016
  4. boundsj commented on Nov 1, 2016

    @boundsj
    Contributor

    This is fixed in #5987. #5987 will be in the next release (beta 2).

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

    annotationsbugiOSperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions