Skip to content
This repository has been 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
futureshape opened this issue Oct 3, 2015 · 7 comments
Labels
iOS Mapbox Maps SDK for iOS

Comments

@futureshape
Copy link

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.

@1ec5
Copy link
Contributor

1ec5 commented Oct 3, 2015

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

@RomainQuidet
Copy link
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)

@1ec5
Copy link
Contributor

1ec5 commented Jan 8, 2016

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

@1ec5 1ec5 closed this as completed Jan 8, 2016
@t-yoshii
Copy link

t-yoshii commented Feb 2, 2016

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?

@1ec5
Copy link
Contributor

1ec5 commented Feb 2, 2016

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

@1ec5 1ec5 reopened this Feb 2, 2016
@jfirebaugh
Copy link
Contributor

#1980 is related / could be considered a duplicate.

@1ec5
Copy link
Contributor

1ec5 commented Feb 15, 2016

OK, duplicate of #1980.

@1ec5 1ec5 closed this as completed Feb 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

6 participants