diff options
author | Jason Wray <jason@mapbox.com> | 2017-07-19 15:18:47 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2017-07-19 15:19:29 -0400 |
commit | 032157a9d140a8f8acb7718a03021f56172ab580 (patch) | |
tree | 54b9d9c7c2bd5df51f7178a51b766cb5ccfde66e | |
parent | 5fabed1077d908180898b45dd3d567795f0056d1 (diff) | |
download | qtlocation-mapboxgl-032157a9d140a8f8acb7718a03021f56172ab580.tar.gz |
Only console log the features-as-annotations warning once per session
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 0be1c87201..3c8b85f4ee 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3189,7 +3189,10 @@ public: if ([annotation conformsToProtocol:@protocol(MGLFeature)]) { - NSLog(@"Warning: Annotations that conform to the MGLFeature protocol do not keep their `identifier` or `attributes` properties when added to the map as annotations. Add this feature using runtime styling if you intend to later query the map for it. %@", annotation.description); + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSLog(@"Annotations that conform to the MGLFeature protocol do not keep their `identifier` or `attributes` properties when added to the map as annotations. Add this feature using runtime styling if you intend to later query the map for it. This warning is only shown once. %@", annotation.description); + }); } // adding the same annotation object twice is a no-op |