From c6e60b8c03631a7ee24c480e10d3e426a400af9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sun, 8 Jan 2017 14:51:57 -0800 Subject: [ios, macos] Test unclusterable shape source shapes --- platform/darwin/test/MGLShapeSourceTests.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'platform/darwin/test/MGLShapeSourceTests.mm') diff --git a/platform/darwin/test/MGLShapeSourceTests.mm b/platform/darwin/test/MGLShapeSourceTests.mm index efff4b393e..2662d4b6f0 100644 --- a/platform/darwin/test/MGLShapeSourceTests.mm +++ b/platform/darwin/test/MGLShapeSourceTests.mm @@ -37,6 +37,19 @@ XCTAssertNil(source.shape); } +- (void)testUnclusterableShape { + NSDictionary *options = @{ + MGLShapeSourceOptionClustered: @YES, + }; + + MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"id" shape:[[MGLPointFeature alloc] init] options:options]; + XCTAssertTrue([source.shape isKindOfClass:[MGLPointFeature class]]); + + MGLShapeCollectionFeature *feature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[]]; + source = [[MGLShapeSource alloc] initWithIdentifier:@"id" shape:feature options:options]; + XCTAssertTrue([source.shape isKindOfClass:[MGLShapeCollectionFeature class]]); +} + - (void)testMGLShapeSourceWithDataMultipleFeatures { NSString *geoJSON = @"{\"type\": \"FeatureCollection\",\"features\": [{\"type\": \"Feature\",\"properties\": {},\"geometry\": {\"type\": \"LineString\",\"coordinates\": [[-107.75390625,40.329795743702064],[-104.34814453125,37.64903402157866]]}}]}"; -- cgit v1.2.1