summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLShapeSourceTests.mm
diff options
context:
space:
mode:
authorJordan Kiley <jmkiley@users.noreply.github.com>2019-10-11 13:46:41 -0700
committerGitHub <noreply@github.com>2019-10-11 13:46:41 -0700
commite4e2a78033f25fd966fa9cbbd2babb7e7b499e18 (patch)
tree6de20c867cab7e548d9cb5bfc46a0e74e63dc2bb /platform/darwin/test/MGLShapeSourceTests.mm
parenta1f124c39442d76af77a5aa63bba5afa4f4d6d26 (diff)
downloadqtlocation-mapboxgl-e4e2a78033f25fd966fa9cbbd2babb7e7b499e18.tar.gz
Add iOS bindings for cluster properties (#15515)
Diffstat (limited to 'platform/darwin/test/MGLShapeSourceTests.mm')
-rw-r--r--platform/darwin/test/MGLShapeSourceTests.mm5
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));