From e38b4b590df2f74b47e25df9c44f4152ef1c582c Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Mon, 12 Dec 2016 10:38:49 -0800 Subject: [ios, macos] Load features into shape source if possible (#7339) This checks the kind of MGLShape passed into the source and, if it is a feature, it mbgl feature objects to pass to core. This keeps the feature id and attributes data intact. If the shape is a `MGLShapeCollectionFeature` it creates an `mbgl::FeatureCollection` object (also to keep feature properties). If the shape is not any sort of feature, it passes along just the geometry. This also uses the MGLFeatureFromMBGLFeature converter for the case where GeoJSON data passed in to a source contains a single feature. The converter has logic to keep the id and attributes properties intact. Before, these properties were lost because only geometry conversion was done. Finally, logic to handle (and associated tests) of nested shape collection features is removed since that is not supported by the GeoJSON spec or the core implementation. [ios] Add test of drawing plain shape to iosapp --- platform/macos/macos.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platform/macos/macos.xcodeproj') diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index b74260ebd8..4997ed0631 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -300,6 +300,7 @@ 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLAdditions.h"; sourceTree = ""; }; 40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayerTests.h; sourceTree = ""; }; 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerTests.m; sourceTree = ""; }; + 40EA2D951DFF163700103590 /* MGLShapeCollectionFeature_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeCollectionFeature_Private.h; sourceTree = ""; }; 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 5548BE791D0ACBB2005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = ""; }; 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = ""; }; @@ -751,6 +752,7 @@ DAE6C34B1CC31E0400DB3429 /* MGLAnnotation.h */, DACC22171CF3D4F700D220D9 /* MGLFeature_Private.h */, DACC22121CF3D3E200D220D9 /* MGLFeature.h */, + 40EA2D951DFF163700103590 /* MGLShapeCollectionFeature_Private.h */, DACC22131CF3D3E200D220D9 /* MGLFeature.mm */, DAE6C36C1CC31E2A00DB3429 /* MGLGeometry_Private.h */, DAE6C34C1CC31E0400DB3429 /* MGLGeometry.h */, -- cgit v1.2.1