You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
varinsertionResult= annotations.insert(annotationOne)if insertionResult.inserted {print("Annotation one inserted")}
insertionResult = annotations.insert(annotationTwo)if insertionResult.inserted {print("Annotation two inserted")}
Expected behavior
The first annotation (annotationOne) should be inserted successfully into the Set. The second annotation (annotationTwo) should not be inserted as an annotation with the same coordinates already exists.
Actual behavior
Both annotations are added to the Set
The text was updated successfully, but these errors were encountered:
Thanks @ollie-eman. I think this will be fixed when #6559 lands. Although, note that in that implementation the hash would not be just a function of coordinate latitude and longitude as you've noted above.
Great thanks @boundsj. Taking into consideration the hash implementation, do you think it will fix the issue i'm having and enable me to store the annotations in a Set? Also, do you know when it might be available via Cocoapods?
Platform: iOS
Mapbox SDK version: 3.3.4
Steps to trigger behavior
I've created a subclass of
MGLPointAnnotation
namedMyCustomAnnotation
and defined a
Set
to store the annotations, to ensure I don't add any duplicates.Next i've created two annotations:
To insert the annotations:
Expected behavior
The first annotation (
annotationOne
) should be inserted successfully into the Set. The second annotation (annotationTwo
) should not be inserted as an annotation with the same coordinates already exists.Actual behavior
Both annotations are added to the
Set
The text was updated successfully, but these errors were encountered: