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.

Modifying annotation should not require removing it and adding it again (iOS) #2517

Closed

Description

@futureshape

Currently, the only way to get the map to show changes in an annotation (especially its image) is is to remove it and add it again i.e.

[self.mapView removeAnnotation:annotation];
[self.mapView addAnnotation:annotation];

This causes flickering (see #1688) but also has the side effect of de-selecting an annotation that was previously selected by the user. There is a workaround for this:

BOOL annotationWasSelected = [self.mapView.selectedAnnotations containsObject:annotation];
[self.mapView removeAnnotation:annotation];
[self.mapView addAnnotation:annotation];
if(annotationWasSelected) [self.mapView selectAnnotation:annotation animated:false];

But ideally it should be possible to modify an annotation is a simpler way.

Activity

  1. 1ec5 commented on Oct 3, 2015

    @1ec5
    Contributor

    Related to #1980, which is about moving the annotation.

  2. added
    iOS
    on Oct 5, 2015
  3. RomainQuidet commented on Nov 30, 2015

    @RomainQuidet
    Contributor

    related to #2210
    Solved by pull request #3146
    Waiting for code review.
    annotation will be updated by modifying its annotationImage.image property which is no more read only (based on native MapKit interface)

  4. 1ec5 commented on Jan 8, 2016

    @1ec5
    Contributor

    This was fixed in #3146 and will be in the next release.

  5. t-yoshii commented on Feb 2, 2016

    @t-yoshii

    Does #3146 also fix to allow annotation coordinate to be updated?

    I want to move annotations without adding/removing to avoid flickering, is it possible?

  6. 1ec5 commented on Feb 2, 2016

    @1ec5
    Contributor

    Oh you're right, that hasn't been addressed yet.

  7. reopened this on Feb 2, 2016
  8. jfirebaugh commented on Feb 15, 2016

    @jfirebaugh
    Contributor

    #1980 is related / could be considered a duplicate.

  9. 1ec5 commented on Feb 15, 2016

    @1ec5
    Contributor

    OK, duplicate of #1980.

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

    iOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions