diff options
author | zmiao <miao.zhao@mapbox.com> | 2019-08-16 15:03:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-16 15:03:48 +0300 |
commit | 0f34eb7b253e83b8c4aef7ed6c83cd7b3801fa4c (patch) | |
tree | a0e06d1c81b04fca84f8ed8effeaeaefc2e79e13 /test/style/conversion/geojson_options.test.cpp | |
parent | 9f8696c00c7ef11abb3850e4694bc7375365295e (diff) | |
download | qtlocation-mapboxgl-0f34eb7b253e83b8c4aef7ed6c83cd7b3801fa4c.tar.gz |
Indroduce clusterProperty option for aggregation (#15287)
* indroduce clusterProperty option for aggregation
* remove unnecessary codes
* update geojson_option conversion
* fix reviewing findings
Diffstat (limited to 'test/style/conversion/geojson_options.test.cpp')
-rw-r--r-- | test/style/conversion/geojson_options.test.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/style/conversion/geojson_options.test.cpp b/test/style/conversion/geojson_options.test.cpp index 181189775b..aa84686dce 100644 --- a/test/style/conversion/geojson_options.test.cpp +++ b/test/style/conversion/geojson_options.test.cpp @@ -38,6 +38,7 @@ TEST(GeoJSONOptions, RetainsDefaults) { ASSERT_EQ(converted.cluster, defaults.cluster); ASSERT_EQ(converted.clusterRadius, defaults.clusterRadius); ASSERT_EQ(converted.clusterMaxZoom, defaults.clusterMaxZoom); + ASSERT_TRUE(converted.clusterProperties.empty()); } TEST(GeoJSONOptions, FullConversion) { @@ -49,7 +50,12 @@ TEST(GeoJSONOptions, FullConversion) { "cluster": true, "clusterRadius": 4, "clusterMaxZoom": 5, - "lineMetrics": true + "lineMetrics": true, + "clusterProperties": { + "max": ["max", ["get", "scalerank"]], + "sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]], + "has_island": ["any", ["==", ["get", "featureclass"], "island"]] + } })JSON", error); // GeoJSON-VT @@ -63,4 +69,8 @@ TEST(GeoJSONOptions, FullConversion) { ASSERT_EQ(converted.cluster, true); ASSERT_EQ(converted.clusterRadius, 4); ASSERT_EQ(converted.clusterMaxZoom, 5); + ASSERT_EQ(converted.clusterProperties.size(), 3); + ASSERT_EQ(converted.clusterProperties.count("max"), 1); + ASSERT_EQ(converted.clusterProperties.count("sum"), 1); + ASSERT_EQ(converted.clusterProperties.count("has_island"), 1); } |