summaryrefslogtreecommitdiff
path: root/platform/ios/src
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2016-08-25 17:14:46 -0400
committerJason Wray <jason@mapbox.com>2016-08-26 17:48:27 -0400
commit018f39544276d469b24f98e2709b43ad75d7536f (patch)
tree3fae432366329e19845048b95376fa779b8dc2da /platform/ios/src
parent2501b2cc7baaf0d2f62aa19298301d066dfab0ea (diff)
downloadqtlocation-mapboxgl-018f39544276d469b24f98e2709b43ad75d7536f.tar.gz
[ios] Ignore non-conforming user location annotation views
Diffstat (limited to 'platform/ios/src')
-rw-r--r--platform/ios/src/MGLMapView.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index c3091a588b..f43029d0bc 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -3824,10 +3824,14 @@ public:
if ([self.delegate respondsToSelector:@selector(mapView:viewForAnnotation:)])
{
userLocationAnnotationView = (MGLUserLocationAnnotationView *)[self.delegate mapView:self viewForAnnotation:self.userLocation];
- if (userLocationAnnotationView)
+ if (userLocationAnnotationView && ! [userLocationAnnotationView isKindOfClass:MGLUserLocationAnnotationView.class])
{
- NSAssert([userLocationAnnotationView.class isSubclassOfClass:MGLUserLocationAnnotationView.class],
- @"User location annotation view must be a subclass of MGLUserLocationAnnotationView");
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSLog(@"Ignoring user location annotation view with type %@. User location annotation view must be a kind of MGLUserLocationAnnotationView. This warning is only shown once and will become an error in a future version.", NSStringFromClass(userLocationAnnotationView.class));
+ });
+
+ userLocationAnnotationView = nil;
}
}