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

[ios] Document annotations-as-features limitations w/feature querying #9807

Merged

Conversation

friedbunny
Copy link
Contributor

@friedbunny friedbunny commented Aug 18, 2017

Addresses this @1ec5 comment from #9540 (review):

We should definitely warn in the feature querying documentation that those methods may return annotations as features – the other way around – but those annotations-as-features aren’t object-equal to the ones that were added to the map. So we should recommend against using feature querying to get annotations.

Also reorders visibleAnnotations to be immediately above visibleAnnotationsInRect:.

@friedbunny friedbunny added documentation iOS Mapbox Maps SDK for iOS labels Aug 18, 2017
@friedbunny friedbunny self-assigned this Aug 18, 2017
@friedbunny friedbunny requested a review from 1ec5 August 18, 2017 19:21
@@ -1254,6 +1254,11 @@ MGL_EXPORT IB_DESIGNABLE
`-[MGLVectorSource featuresInSourceLayersWithIdentifiers:predicate:]` and
`-[MGLShapeSource featuresMatchingPredicate:]` methods on the relevant sources.

The returned features may also include annotations that do not conform to
`MGLFeature`. These annotations will not be object-equal to those that were
originally added to the map. To query the map for annotations, use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s difficult to convey the nuances around object wrapping, but maybe this will help:

The returned features may also include features corresponding to annotations. These features are not object-equal to the MGLAnnotation objects that were originally added to the map.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I’ve updated this PR to use your verbiage.

@friedbunny friedbunny added this to the ios-v3.6.3 milestone Aug 18, 2017
Also move visibleAnnotations next to visibleAnnotationsInRect:.
@friedbunny friedbunny merged commit acb8199 into release-ios-v3.6.0-android-v5.1.0 Aug 21, 2017
@friedbunny friedbunny deleted the fb-annotations-as-features branch August 21, 2017 16:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants