summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-09-10 13:40:13 -0700
committerMinh Nguyễn <mxn@1ec5.org>2017-11-02 15:19:54 -0700
commit56088bfa0322619330d79460bb987a09ebf5bfb8 (patch)
treeb468580b43d1b4525d1e94a53dea3d6f5932a9c3
parent226033a825bc6b7869c45572568bbd93d9d65055 (diff)
downloadqtlocation-mapboxgl-56088bfa0322619330d79460bb987a09ebf5bfb8.tar.gz
[ios] Find place feature accessibility elements by identifier
-rw-r--r--platform/ios/src/MGLMapView.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index efe538aebc..c59eff6569 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2633,6 +2633,16 @@ public:
{
id <MGLFeature> feature = [(MGLFeatureAccessibilityElement *)element feature];
NSUInteger featureIndex = [visiblePlaceFeatures indexOfObject:feature];
+ if (featureIndex == NSNotFound)
+ {
+ featureIndex = [visiblePlaceFeatures indexOfObjectPassingTest:^BOOL (id <MGLFeature> _Nonnull visibleFeature, NSUInteger idx, BOOL * _Nonnull stop) {
+ return [visibleFeature.identifier isEqual:feature.identifier];
+ }];
+ }
+ if (featureIndex == NSNotFound)
+ {
+ return NSNotFound;
+ }
return visiblePlaceFeatureRange.location + featureIndex;
}