summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-10-20 17:14:19 -0700
committerGitHub <noreply@github.com>2016-10-20 17:14:19 -0700
commit1216050f9c5c472f1c8edcc32447004a40680ec7 (patch)
tree77f937aaeaa6e34f8b2fa84e5f7c721e8f3d541f /platform/ios
parentbaf82fc4d4882480e6dd16ea9821be29d390bf00 (diff)
downloadqtlocation-mapboxgl-1216050f9c5c472f1c8edcc32447004a40680ec7.tar.gz
Add MGLPointCollection for GeoJSON multipoints (#6742)
* [ios, macos] Introduce MGLPointCollection This makes MGLMultiPoint abstract again so that it is only a place for shared functionality of polygons and polylines. The multipoint feature replaces the point collection feature and can be used to initialize a MGLGeoJSONSource. The previously added swift_names for polyline and polygon are removed, for now. This also updates the iOS and macOS annotation adding logic so that unwanted shapes really are avoided. Previously the combined OR conditions meant that an annotation had to logically be NOT a kind of all three types so the check always let the annotation slip through. This also expands the guard to deflect the new MGLPointCollection.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/CHANGELOG.md2
-rw-r--r--platform/ios/app/MBXViewController.m22
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj18
-rw-r--r--platform/ios/jazzy.yml3
-rw-r--r--platform/ios/src/MGLMapView.h9
-rw-r--r--platform/ios/src/MGLMapView.mm12
-rw-r--r--platform/ios/src/Mapbox.h1
-rw-r--r--platform/ios/test/MGLGeoJSONSourceTests.mm72
8 files changed, 72 insertions, 67 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index a83041edd4..8587f31d30 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -32,6 +32,8 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Improved style parsing performance. ([#6170](https://github.com/mapbox/mapbox-gl-native/pull/6170))
* Improved feature querying performance. ([#6514](https://github.com/mapbox/mapbox-gl-native/pull/6514))
* A feature's `identifier` and `attributes` properties can now be mutated. ([#6728](https://github.com/mapbox/mapbox-gl-native/pull/6728))
+* Fixed an issue causing abstract `MGLMultiPointFeature` objects to be returned in feature query results. Now concrete `MGLPointCollectionFeature` objects are returned. ([#6742](https://github.com/mapbox/mapbox-gl-native/pull/6742))
+* Fixed an issue where shapes that cannot currently be visually represented as annotations were still shown on the map as point annotations. ([#6764](https://github.com/mapbox/mapbox-gl-native/issues/6764))
### User location
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 63e39e54a6..3a58c1163a 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -63,6 +63,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsRuntimeStylingRows) {
MBXSettingsRuntimeStylingNumericFilteredFill,
MBXSettingsRuntimeStylingStyleQuery,
MBXSettingsRuntimeStylingFeatureSource,
+ MBXSettingsRuntimeStylingPointCollection,
};
typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
@@ -308,6 +309,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
@"Style Fill With Numeric Filter",
@"Style Query For GeoJSON",
@"Style Feature",
+ @"Style Dynamic Point Collection",
]];
break;
case MBXSettingsMiscellaneous:
@@ -439,6 +441,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
case MBXSettingsRuntimeStylingFeatureSource:
[self styleFeature];
break;
+ case MBXSettingsRuntimeStylingPointCollection:
+ [self styleDynamicPointCollection];
+ break;
default:
NSAssert(NO, @"All runtime styling setting rows should be implemented");
break;
@@ -886,6 +891,23 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self.mapView.style addLayer:layer];
}
+- (void)styleDynamicPointCollection
+{
+ [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(36.9979, -109.0441) zoomLevel:14 animated:NO];
+ CLLocationCoordinate2D coordinates[] = {
+ {37.00145594210082, -109.04960632324219},
+ {37.00173012609867, -109.0404224395752},
+ {36.99453246847359, -109.04960632324219},
+ {36.99508088541243, -109.04007911682129},
+ };
+ MGLPointCollectionFeature *feature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:4];
+ MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"wiggle-source" features:@[feature] options:nil];
+ [self.mapView.style addSource:source];
+
+ MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"wiggle-layer" source:source];
+ [self.mapView.style addLayer:layer];
+}
+
- (IBAction)startWorldTour
{
_isTouringWorld = YES;
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 3c19f5ea41..8253774766 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -128,6 +128,11 @@
4018B1CA1CDC288E00F666AF /* MGLAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4018B1C51CDC277F00F666AF /* MGLAnnotationView.h */; settings = {ATTRIBUTES = (Public, ); }; };
4018B1CB1CDC288E00F666AF /* MGLAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4018B1C51CDC277F00F666AF /* MGLAnnotationView.h */; settings = {ATTRIBUTES = (Public, ); }; };
404326891D5B9B27007111BD /* MGLAnnotationContainerView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 404326881D5B9B1A007111BD /* MGLAnnotationContainerView_Private.h */; };
+ 4049C29D1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4049C29E1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4049C29F1DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4049C29C1DB6CD6C00B3F799 /* MGLPointCollection.mm */; };
+ 4049C2A01DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4049C29C1DB6CD6C00B3F799 /* MGLPointCollection.mm */; };
+ 4049C2AC1DB6E05500B3F799 /* MGLPointCollection_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C2AB1DB6E05500B3F799 /* MGLPointCollection_Private.h */; };
404C26E21D89B877000AA13D /* MGLTileSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 404C26E01D89B877000AA13D /* MGLTileSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
404C26E31D89B877000AA13D /* MGLTileSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 404C26E01D89B877000AA13D /* MGLTileSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
404C26E41D89B877000AA13D /* MGLTileSet.mm in Sources */ = {isa = PBXBuildFile; fileRef = 404C26E11D89B877000AA13D /* MGLTileSet.mm */; };
@@ -555,6 +560,9 @@
4018B1C51CDC277F00F666AF /* MGLAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationView.h; sourceTree = "<group>"; };
402E9DE01CD2C76200FD4519 /* Mapbox.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Mapbox.playground; sourceTree = "<group>"; };
404326881D5B9B1A007111BD /* MGLAnnotationContainerView_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationContainerView_Private.h; sourceTree = "<group>"; };
+ 4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointCollection.h; sourceTree = "<group>"; };
+ 4049C29C1DB6CD6C00B3F799 /* MGLPointCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPointCollection.mm; sourceTree = "<group>"; };
+ 4049C2AB1DB6E05500B3F799 /* MGLPointCollection_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointCollection_Private.h; sourceTree = "<group>"; };
404C26E01D89B877000AA13D /* MGLTileSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTileSet.h; sourceTree = "<group>"; };
404C26E11D89B877000AA13D /* MGLTileSet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLTileSet.mm; sourceTree = "<group>"; };
404C26E61D89C515000AA13D /* MGLTileSet_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLTileSet_Private.h; sourceTree = "<group>"; };
@@ -1257,12 +1265,15 @@
DA8847E11CBAFA5100AB86E3 /* MGLGeometry.h */,
DA8848011CBAFA6200AB86E3 /* MGLGeometry_Private.h */,
DA8848021CBAFA6200AB86E3 /* MGLGeometry.mm */,
- DA8847E31CBAFA5100AB86E3 /* MGLMultiPoint.h */,
DA8848041CBAFA6200AB86E3 /* MGLMultiPoint_Private.h */,
+ DA8847E31CBAFA5100AB86E3 /* MGLMultiPoint.h */,
DA8848051CBAFA6200AB86E3 /* MGLMultiPoint.mm */,
DA8847E71CBAFA5100AB86E3 /* MGLOverlay.h */,
DA8847E81CBAFA5100AB86E3 /* MGLPointAnnotation.h */,
DA88480B1CBAFA6200AB86E3 /* MGLPointAnnotation.mm */,
+ 4049C29B1DB6CD6C00B3F799 /* MGLPointCollection.h */,
+ 4049C2AB1DB6E05500B3F799 /* MGLPointCollection_Private.h */,
+ 4049C29C1DB6CD6C00B3F799 /* MGLPointCollection.mm */,
DA8847E91CBAFA5100AB86E3 /* MGLPolygon.h */,
DA88480C1CBAFA6200AB86E3 /* MGLPolygon.mm */,
DA8847EA1CBAFA5100AB86E3 /* MGLPolyline.h */,
@@ -1410,6 +1421,7 @@
DA8847F01CBAFA5100AB86E3 /* MGLAnnotation.h in Headers */,
7E016D841D9E890300A29A21 /* MGLPolygon+MGLAdditions.h in Headers */,
400533011DB0862B0069F638 /* NSArray+MGLAdditions.h in Headers */,
+ 4049C29D1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */,
DA88483E1CBAFB8500AB86E3 /* MGLMapView+MGLCustomStyleLayerAdditions.h in Headers */,
40CF6DBB1DAC3C6600A4D18B /* MGLShape_Private.h in Headers */,
4018B1CA1CDC288E00F666AF /* MGLAnnotationView.h in Headers */,
@@ -1449,6 +1461,7 @@
35136D4C1D4277FC00C20EFD /* MGLSource.h in Headers */,
3566C76C1D4A8DFA008152BC /* MGLRasterSource.h in Headers */,
DA8847F91CBAFA5100AB86E3 /* MGLPolygon.h in Headers */,
+ 4049C2AC1DB6E05500B3F799 /* MGLPointCollection_Private.h in Headers */,
DA8847F81CBAFA5100AB86E3 /* MGLPointAnnotation.h in Headers */,
353933F21D3FB753003F57D7 /* MGLCircleStyleLayer.h in Headers */,
DA8847F31CBAFA5100AB86E3 /* MGLMultiPoint.h in Headers */,
@@ -1493,6 +1506,7 @@
DABFB85E1CBE99E500D62B32 /* MGLAnnotation.h in Headers */,
DABFB8641CBE99E500D62B32 /* MGLOfflineStorage.h in Headers */,
DAD165791CF4CDFF001FF4B9 /* MGLShapeCollection.h in Headers */,
+ 4049C29E1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */,
3566C7671D4A77BA008152BC /* MGLGeoJSONSource.h in Headers */,
DA35A29F1CC9E94C00E826B2 /* MGLCoordinateFormatter.h in Headers */,
DABFB8711CBE9A0F00D62B32 /* MGLMapView+MGLCustomStyleLayerAdditions.h in Headers */,
@@ -1943,6 +1957,7 @@
35D13AC51D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */,
DA8848241CBAFA6200AB86E3 /* MGLOfflineStorage.mm in Sources */,
DA88482A1CBAFA6200AB86E3 /* MGLTilePyramidOfflineRegion.mm in Sources */,
+ 4049C29F1DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */,
35136D3F1D42273000C20EFD /* MGLLineStyleLayer.mm in Sources */,
DA88481A1CBAFA6200AB86E3 /* MGLAccountManager.m in Sources */,
3510FFFB1D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.mm in Sources */,
@@ -2014,6 +2029,7 @@
35D13AC61D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */,
DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */,
DAA4E4211CBB730400178DFB /* MGLOfflineStorage.mm in Sources */,
+ 4049C2A01DB6CD6C00B3F799 /* MGLPointCollection.mm in Sources */,
35136D401D42273000C20EFD /* MGLLineStyleLayer.mm in Sources */,
DAA4E42F1CBB730400178DFB /* MGLCompactCalloutView.m in Sources */,
3510FFFC1D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.mm in Sources */,
diff --git a/platform/ios/jazzy.yml b/platform/ios/jazzy.yml
index c41dddc899..c19d9e3883 100644
--- a/platform/ios/jazzy.yml
+++ b/platform/ios/jazzy.yml
@@ -34,6 +34,7 @@ custom_categories:
- MGLMultiPolygon
- MGLMultiPolyline
- MGLPointAnnotation
+ - MGLPointCollection
- MGLPolygon
- MGLPolyline
- MGLOverlay
@@ -44,9 +45,9 @@ custom_categories:
- name: Map Data
children:
- MGLFeature
- - MGLMultiPointFeature
- MGLMultiPolygonFeature
- MGLMultiPolylineFeature
+ - MGLPointCollectionFeature
- MGLPointFeature
- MGLPolygonFeature
- MGLPolylineFeature
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 57b74daa04..5a89632db8 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -895,11 +895,10 @@ IB_DESIGNABLE
/**
Adds an annotation to the map view.
- @note `MGLMultiPolyline`, `MGLMultiPolygon`, and `MGLShapeCollection` objects
- cannot be added to the map view at this time. Nor can `MGLMultiPoint`
- objects that are not instances of `MGLPolyline` or `MGLPolygon`. Any
- multipoint, multipolyline, multipolygon, or shape collection object that is
- specified is silently ignored.
+ @note `MGLMultiPolyline`, `MGLMultiPolygon`, `MGLShapeCollection`, and
+ `MGLPointCollection` objects cannot be added to the map view at this time.
+ Any multipoint, multipolyline, multipolygon, shape or point collection
+ object that is specified is silently ignored.
@param annotation The annotation object to add to the receiver. This object
must conform to the `MGLAnnotation` protocol. The map view retains the
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 88f4d8a970..bb7e446620 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2855,13 +2855,6 @@ public:
if ([annotation isKindOfClass:[MGLMultiPoint class]])
{
- // Actual multipoints aren’t supported as annotations.
- if ([annotation isMemberOfClass:[MGLMultiPoint class]]
- || [annotation isMemberOfClass:[MGLMultiPointFeature class]])
- {
- continue;
- }
-
// The polyline or polygon knows how to style itself (with the map view’s help).
MGLMultiPoint *multiPoint = (MGLMultiPoint *)annotation;
if (!multiPoint.pointCount) {
@@ -2876,8 +2869,9 @@ public:
[(NSObject *)annotation addObserver:self forKeyPath:@"coordinates" options:0 context:(void *)(NSUInteger)annotationTag];
}
else if ( ! [annotation isKindOfClass:[MGLMultiPolyline class]]
- || ![annotation isKindOfClass:[MGLMultiPolygon class]]
- || ![annotation isKindOfClass:[MGLShapeCollection class]])
+ && ![annotation isKindOfClass:[MGLMultiPolygon class]]
+ && ![annotation isKindOfClass:[MGLShapeCollection class]]
+ && ![annotation isKindOfClass:[MGLPointCollection class]])
{
MGLAnnotationView *annotationView;
NSString *symbolName;
diff --git a/platform/ios/src/Mapbox.h b/platform/ios/src/Mapbox.h
index 04892eb6a1..c2fda1be1f 100644
--- a/platform/ios/src/Mapbox.h
+++ b/platform/ios/src/Mapbox.h
@@ -27,6 +27,7 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[];
#import "MGLOfflineStorage.h"
#import "MGLOverlay.h"
#import "MGLPointAnnotation.h"
+#import "MGLPointCollection.h"
#import "MGLPolygon.h"
#import "MGLPolyline.h"
#import "MGLShape.h"
diff --git a/platform/ios/test/MGLGeoJSONSourceTests.mm b/platform/ios/test/MGLGeoJSONSourceTests.mm
index 935d9a0ae3..c885873f77 100644
--- a/platform/ios/test/MGLGeoJSONSourceTests.mm
+++ b/platform/ios/test/MGLGeoJSONSourceTests.mm
@@ -139,54 +139,6 @@
XCTAssertTrue([source.features.firstObject isMemberOfClass:[MGLPolygonFeature class]]);
}
-
-- (void)testMGLGeoJSONSourceWithMultiPointFeaturesUsingPolylines {
- CLLocationCoordinate2D coordinates[] = {
- CLLocationCoordinate2DMake(100.0, 0.0),
- CLLocationCoordinate2DMake(101.0, 0.0),
- CLLocationCoordinate2DMake(101.0, 1.0),
- CLLocationCoordinate2DMake(100.0, 1.0),
- CLLocationCoordinate2DMake(100.0, 0.0)};
-
- MGLMultiPointFeature *multiPointFeature = [MGLMultiPointFeature multiPointWithCoordinates:coordinates count:5];
-
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" features:@[multiPointFeature] options:nil];
-
- std::unique_ptr<mbgl::style::Source> mbglSource = [source mbglSource];
-
- XCTAssertNotNil(source.features);
- XCTAssertEqual(source.features.count, 1);
- XCTAssertTrue([source.features.firstObject isMemberOfClass:[MGLMultiPointFeature class]]);
-}
-
-- (void)testMGLGeoJSONSourceWithMultiPointFeaturesUsingPolygons {
- CLLocationCoordinate2D coordinates[] = {
- CLLocationCoordinate2DMake(100.0, 0.0),
- CLLocationCoordinate2DMake(101.0, 0.0),
- CLLocationCoordinate2DMake(101.0, 1.0),
- CLLocationCoordinate2DMake(100.0, 1.0),
- CLLocationCoordinate2DMake(100.0, 0.0)};
-
- CLLocationCoordinate2D interiorCoordinates[] = {
- CLLocationCoordinate2DMake(100.2, 0.2),
- CLLocationCoordinate2DMake(100.8, 0.2),
- CLLocationCoordinate2DMake(100.8, 0.8),
- CLLocationCoordinate2DMake(100.2, 0.8),
- CLLocationCoordinate2DMake(100.2, 0.2)};
-
- MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:interiorCoordinates count:5];
-
- MGLMultiPointFeature *multiPointFeature = (MGLMultiPointFeature *)[MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]];
-
- MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"source-id" features:@[multiPointFeature] options:nil];
-
- std::unique_ptr<mbgl::style::Source> mbglSource = [source mbglSource];
-
- XCTAssertNotNil(source.features);
- XCTAssertEqual(source.features.count, 1);
- XCTAssertTrue([source.features.firstObject isMemberOfClass:[MGLPolygonFeature class]]);
-}
-
- (void)testMGLGeoJSONSourceWithMultiPolylineFeatures {
CLLocationCoordinate2D firstCoordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)};
MGLPolylineFeature *firstPolylineFeature = [MGLPolylineFeature polylineWithCoordinates:firstCoordinates count:2];
@@ -248,6 +200,24 @@
XCTAssertTrue([source.features.firstObject isMemberOfClass:[MGLPointFeature class]]);
}
+- (void)testMGLGeoJSONSourceWithPointCollectionFeature {
+ CLLocationCoordinate2D coordinates[] = {
+ CLLocationCoordinate2DMake(100.0, 0.0),
+ CLLocationCoordinate2DMake(101.0, 0.0),
+ CLLocationCoordinate2DMake(101.0, 1.0),
+ CLLocationCoordinate2DMake(100.0, 1.0),
+ CLLocationCoordinate2DMake(100.0, 0.0)};
+ MGLPointCollectionFeature *pointCollectionFeature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5];
+;
+ MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"souce-id" features:@[pointCollectionFeature] options:nil];
+
+ std::unique_ptr<mbgl::style::Source> mbglSource = [source mbglSource];
+
+ XCTAssertNotNil(source.features);
+ XCTAssertEqual(source.features.count, 1);
+ XCTAssertTrue([source.features.firstObject isMemberOfClass:[MGLPointCollectionFeature class]]);
+}
+
- (void)testMGLGeoJSONSourceWithShapeCollectionFeatures {
CLLocationCoordinate2D coordinates[] = {
CLLocationCoordinate2DMake(100.0, 0.0),
@@ -274,14 +244,14 @@
MGLMultiPolylineFeature *multiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:@[polylineFeature, polylineFeature]];
- MGLMultiPointFeature *multiPointFeature = (MGLMultiPointFeature *)[MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]];
+ MGLPointCollectionFeature *pointCollectionFeature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5];
MGLPointFeature *pointFeature = [MGLPointFeature new];
pointFeature.coordinate = CLLocationCoordinate2DMake(100.2, 0.2);
- MGLShapeCollectionFeature *shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, multiPointFeature, pointFeature]];
+ MGLShapeCollectionFeature *shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, pointCollectionFeature, pointFeature]];
- MGLShapeCollectionFeature *shapeCollectionFeature_1 = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, multiPointFeature, pointFeature, shapeCollectionFeature]];
+ MGLShapeCollectionFeature *shapeCollectionFeature_1 = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, pointCollectionFeature, pointFeature, shapeCollectionFeature]];
MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithIdentifier:@"" features:@[shapeCollectionFeature_1] options:nil];