diff options
Diffstat (limited to 'platform/darwin/test/MGLShapeSourceTests.mm')
-rw-r--r-- | platform/darwin/test/MGLShapeSourceTests.mm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLShapeSourceTests.mm b/platform/darwin/test/MGLShapeSourceTests.mm index 3459fb1733..3bf3ef04bd 100644 --- a/platform/darwin/test/MGLShapeSourceTests.mm +++ b/platform/darwin/test/MGLShapeSourceTests.mm @@ -13,8 +13,12 @@ @implementation MGLShapeSourceTests - (void)testGeoJSONOptionsFromDictionary { + NSExpression *reduceExpression = [NSExpression expressionForFunction:@"sum:" arguments:@[[NSExpression expressionForKeyPath:@"featureAccumulated"], [NSExpression expressionForKeyPath:@"sumValue"]]]; + NSExpression *mapExpression = [NSExpression expressionForKeyPath:@"mag"]; + NSArray *clusterPropertyArray = @[reduceExpression, mapExpression]; NSDictionary *options = @{MGLShapeSourceOptionClustered: @YES, MGLShapeSourceOptionClusterRadius: @42, + MGLShapeSourceOptionClusterProperties: @{@"sumValue": clusterPropertyArray}, MGLShapeSourceOptionMaximumZoomLevelForClustering: @98, MGLShapeSourceOptionMaximumZoomLevel: @99, MGLShapeSourceOptionBuffer: @1976, @@ -29,6 +33,7 @@ XCTAssertEqual(mbglOptions.buffer, 1976); XCTAssertEqual(mbglOptions.tolerance, 0.42); XCTAssertTrue(mbglOptions.lineMetrics); + XCTAssertTrue(!mbglOptions.clusterProperties.empty()); options = @{MGLShapeSourceOptionClustered: @"number 1"}; XCTAssertThrows(MGLGeoJSONOptionsFromDictionary(options)); |