summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadia Barbosa <nadiabarbosa@me.com>2018-08-17 11:48:00 -0700
committerNadia Barbosa <nadiabarbosa@me.com>2018-08-20 14:02:30 -0700
commite3cb43fe8d6aa2380419789819cc3e8bd12bb457 (patch)
tree17b4439169115c30ea99b1da0fc5673b72d92352
parent078d268c44522eff89333ca6b89358b8f24361db (diff)
downloadqtlocation-mapboxgl-e3cb43fe8d6aa2380419789819cc3e8bd12bb457.tar.gz
Move warning from ShapeCollection to ShapeSource
-rw-r--r--platform/darwin/src/MGLShapeCollection.mm12
-rw-r--r--platform/darwin/src/MGLShapeSource.mm8
2 files changed, 8 insertions, 12 deletions
diff --git a/platform/darwin/src/MGLShapeCollection.mm b/platform/darwin/src/MGLShapeCollection.mm
index 36c3e15900..5db1ee335c 100644
--- a/platform/darwin/src/MGLShapeCollection.mm
+++ b/platform/darwin/src/MGLShapeCollection.mm
@@ -14,18 +14,6 @@
- (instancetype)initWithShapes:(NSArray<MGLShape *> *)shapes {
if (self = [super init]) {
_shapes = shapes.copy;
-
- for (MGLShape* shape in shapes ){
- if ([shape conformsToProtocol:@protocol(MGLFeature)]) {
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- NSLog(@"Shape collection will not retain attributes from objects conforming to MGLFeature protocol."
- @"Use MGLShapeCollectionFeature instead."
- @"This will be logged only once.");
- });
- }
- break;
- }
}
return self;
}
diff --git a/platform/darwin/src/MGLShapeSource.mm b/platform/darwin/src/MGLShapeSource.mm
index 1425269012..9457d2569a 100644
--- a/platform/darwin/src/MGLShapeSource.mm
+++ b/platform/darwin/src/MGLShapeSource.mm
@@ -105,6 +105,14 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShap
auto geoJSONOptions = MGLGeoJSONOptionsFromDictionary(options);
auto source = std::make_unique<mbgl::style::GeoJSONSource>(identifier.UTF8String, geoJSONOptions);
if (self = [super initWithPendingSource:std::move(source)]) {
+ if ([shape isMemberOfClass:[MGLShapeCollection class]]) {
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSLog(@"MGLShapeCollection initialized with MGLFeatures will not retain attributes."
+ @"Use MGLShapeCollectionFeature to retain attributes instead."
+ @"This will be logged only once.");
+ });
+ }
self.shape = shape;
}
return self;