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

Updating "MGLPointAnnotation" coordinate does not change annotation placement on a map #1980

Closed
xrayed opened this issue Aug 3, 2015 · 4 comments
Assignees
Labels
feature iOS Mapbox Maps SDK for iOS
Milestone

Comments

@xrayed
Copy link

xrayed commented Aug 3, 2015

Mapbox GL 0.5.1

@1ec5 1ec5 added feature iOS Mapbox Maps SDK for iOS labels Aug 3, 2015
@1ec5
Copy link
Contributor

1ec5 commented Aug 3, 2015

For now, the workaround is to remove the annotation and add it back at the new coordinates.

@bwhtmn
Copy link
Contributor

bwhtmn commented Aug 5, 2015

It seems that the workaround would be affected by issue #1688.

@friedbunny
Copy link
Contributor

We have core support for updating the position of point annotations in #3933, which was implemented in Android in #3943. That means we’re on track for getting this in iOS.

1ec5 added a commit that referenced this issue Apr 17, 2016
MGLMapView observes changes to the coordinate property of each MGLAnnotation added to it. Changing the coordinate property in a KVO-compliant way causes the annotation to be relocated and its callout view, if present, to be dismissed. To avoid observing the same annotation twice yet also avoid expensive lookups when adding or removing annotations, MGLMapView indexes added point annotations in an NSMutableSet.

In iosapp, tapping a callout view moves the selected annotation to the center of the screen and deselects it.

Fixes #1980.
@1ec5
Copy link
Contributor

1ec5 commented Apr 18, 2016

The fix for this issue is ready for review: #3835.

@1ec5 1ec5 self-assigned this Apr 18, 2016
1ec5 added a commit that referenced this issue Apr 19, 2016
MGLMapView observes changes to the coordinate property of each MGLAnnotation added to it. Changing the coordinate property in a KVO-compliant way causes the annotation to be relocated and its callout view, if present, to be dismissed. To avoid observing the same annotation twice yet also avoid expensive lookups when adding or removing annotations, MGLMapView indexes added point annotations in an NSMutableSet.

In iosapp, tapping a callout view moves the selected annotation to the center of the screen and deselects it.

Fixes #1980.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

4 participants