summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadia Barbosa <nadiabarbosa@me.com>2018-08-20 13:11:14 -0700
committerNadia Barbosa <nadiabarbosa@me.com>2018-08-20 14:02:30 -0700
commita7f7b0938ad8e81e20fea55b20cc6899c3360380 (patch)
tree13622ace589004f1a22c85263c752bb3f0d9392f
parente3cb43fe8d6aa2380419789819cc3e8bd12bb457 (diff)
downloadqtlocation-mapboxgl-upstream/nb-warn-attribute-loss-11287.tar.gz
Try checking MGLComputedShapeSourcesupstream/nb-warn-attribute-loss-11287
-rw-r--r--platform/darwin/src/MGLComputedShapeSource.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLComputedShapeSource.mm b/platform/darwin/src/MGLComputedShapeSource.mm
index 609db7f399..5c8da74ac4 100644
--- a/platform/darwin/src/MGLComputedShapeSource.mm
+++ b/platform/darwin/src/MGLComputedShapeSource.mm
@@ -131,6 +131,14 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi
mbgl::FeatureCollection featureCollection;
featureCollection.reserve(data.count);
for (MGLShape <MGLFeature> * feature in data) {
+ if ([feature 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.");
+ });
+ }
mbgl::Feature geoJsonObject = [feature geoJSONObject].get<mbgl::Feature>();
featureCollection.push_back(geoJsonObject);
}
@@ -196,6 +204,14 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi
for (MGLShape <MGLFeature> * feature in features) {
mbgl::Feature geoJsonObject = [feature geoJSONObject].get<mbgl::Feature>();
featureCollection.push_back(geoJsonObject);
+ if ([feature 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.");
+ });
+ }
}
const auto geojson = mbgl::GeoJSON{featureCollection};
static_cast<mbgl::style::CustomGeometrySource *>(self.rawSource)->setTileData(tileID, geojson);