summaryrefslogtreecommitdiff
path: root/metrics
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-04-15 18:15:29 +0300
committergalinelle <paolo.angelelli@mapbox.com>2020-04-17 22:26:32 +0300
commitfea8a83e7f72ba59e41e713b3a37f6b946565d74 (patch)
treea1ca136e4d33d63f9ffb07cf6aa107c331ace992 /metrics
parentc4b061bd959a0efa5d0202d16d39e92e4f416abb (diff)
downloadqtlocation-mapboxgl-fea8a83e7f72ba59e41e713b3a37f6b946565d74.tar.gz
Introduce a mean to add render features in layers with no sources
This change also uses the support in the LocationIndicator layer, to return a point feature when queried in correspondence of the location indicator.
Diffstat (limited to 'metrics')
-rw-r--r--metrics/ignores/platform-linux.json5
-rw-r--r--metrics/tests/location_indicator/query_test/expected.json16
-rw-r--r--metrics/tests/location_indicator/query_test/style.json66
-rw-r--r--metrics/tests/location_indicator/query_test_miss/expected.json1
-rw-r--r--metrics/tests/location_indicator/query_test_miss/style.json66
-rw-r--r--metrics/tests/location_indicator/query_test_no_image/expected.json1
-rw-r--r--metrics/tests/location_indicator/query_test_no_image/style.json65
7 files changed, 219 insertions, 1 deletions
diff --git a/metrics/ignores/platform-linux.json b/metrics/ignores/platform-linux.json
index ec018eb805..9d3f0d491c 100644
--- a/metrics/ignores/platform-linux.json
+++ b/metrics/ignores/platform-linux.json
@@ -22,5 +22,8 @@
"location_indicator/tilted_texture_shift_top_right": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
"location_indicator/two_textures": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
"location_indicator/image_pixel_ratio": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
- "location_indicator/change_image": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering"
+ "location_indicator/change_image": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
+ "location_indicator/query_test": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
+ "location_indicator/query_test_no_image": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
+ "location_indicator/query_test_miss": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering"
}
diff --git a/metrics/tests/location_indicator/query_test/expected.json b/metrics/tests/location_indicator/query_test/expected.json
new file mode 100644
index 0000000000..3104dfe82d
--- /dev/null
+++ b/metrics/tests/location_indicator/query_test/expected.json
@@ -0,0 +1,16 @@
+[
+ {
+ "type": "Feature",
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 35.693055,
+ 139.766707
+ ]
+ },
+ "properties": {},
+ "source": "",
+ "sourceLayer": "puck123",
+ "state": {}
+ }
+] \ No newline at end of file
diff --git a/metrics/tests/location_indicator/query_test/style.json b/metrics/tests/location_indicator/query_test/style.json
new file mode 100644
index 0000000000..efc09922aa
--- /dev/null
+++ b/metrics/tests/location_indicator/query_test/style.json
@@ -0,0 +1,66 @@
+{
+ "version": 8,
+ "metadata": {
+ "test": {
+ "width": 512,
+ "height": 256,
+ "operations": [
+ [
+ "addImage",
+ "puck_hat",
+ "puck_hat.png"
+ ],
+ [
+ "addImage",
+ "puck",
+ "puck.png"
+ ],
+ [
+ "addImage",
+ "puck_shadow",
+ "puck_shadow.png"
+ ]
+ ],
+ "queryGeometry": [
+ 256,
+ 128
+ ]
+ }
+ },
+ "center": [ 139.766707, 35.693055 ],
+ "zoom": 16,
+ "pitch" : 60,
+ "bearing" : 42,
+ "sources": {},
+ "layers": [
+ {
+ "id": "background",
+ "type": "background",
+ "paint": {
+ "background-color": "white"
+ }
+ },
+ {
+ "id": "puck123",
+ "type": "location-indicator",
+ "layout" : {
+ "bearing-image" : "puck",
+ "top-image" : "puck_hat",
+ "shadow-image" : "puck_shadow"
+ },
+ "paint" : {
+ "bearing" : 45,
+ "perspective-compensation" : 1,
+ "image-tilt-displacement" : 0,
+ "location" : [ 35.693055, 139.766707, 0],
+ "accuracy-radius": 90.0,
+ "bearing-image-size" : 0.26,
+ "top-image-size" : 0.18,
+ "shadow-image-size" : 0.2,
+
+ "accuracy-radius-color": "rgba(255,0,0,0.2)",
+ "accuracy-radius-border-color": "rgba(255,0,255,0.6)"
+ }
+ }
+ ]
+}
diff --git a/metrics/tests/location_indicator/query_test_miss/expected.json b/metrics/tests/location_indicator/query_test_miss/expected.json
new file mode 100644
index 0000000000..0637a088a0
--- /dev/null
+++ b/metrics/tests/location_indicator/query_test_miss/expected.json
@@ -0,0 +1 @@
+[] \ No newline at end of file
diff --git a/metrics/tests/location_indicator/query_test_miss/style.json b/metrics/tests/location_indicator/query_test_miss/style.json
new file mode 100644
index 0000000000..8ff5b51c39
--- /dev/null
+++ b/metrics/tests/location_indicator/query_test_miss/style.json
@@ -0,0 +1,66 @@
+{
+ "version": 8,
+ "metadata": {
+ "test": {
+ "width": 512,
+ "height": 256,
+ "operations": [
+ [
+ "addImage",
+ "puck_hat",
+ "puck_hat.png"
+ ],
+ [
+ "addImage",
+ "puck",
+ "puck.png"
+ ],
+ [
+ "addImage",
+ "puck_shadow",
+ "puck_shadow.png"
+ ]
+ ],
+ "queryGeometry": [
+ 160,
+ 128
+ ]
+ }
+ },
+ "center": [ 139.766707, 35.693055 ],
+ "zoom": 16,
+ "pitch" : 60,
+ "bearing" : 42,
+ "sources": {},
+ "layers": [
+ {
+ "id": "background",
+ "type": "background",
+ "paint": {
+ "background-color": "white"
+ }
+ },
+ {
+ "id": "puck123",
+ "type": "location-indicator",
+ "layout" : {
+ "bearing-image" : "puck",
+ "top-image" : "puck_hat",
+ "shadow-image" : "puck_shadow"
+ },
+ "paint" : {
+ "bearing" : 45,
+ "perspective-compensation" : 1,
+ "image-tilt-displacement" : 0,
+ "location" : [ 35.693055, 139.766707, 0],
+ "accuracy-radius": 90.0,
+ "bearing-image-size" : 0.26,
+ "top-image-size" : 0.18,
+ "shadow-image-size" : 0.2,
+
+ "accuracy-radius-color": "rgba(255,0,0,0.2)",
+ "accuracy-radius-border-color": "rgba(255,0,255,0.6)"
+ }
+ }
+ ]
+}
diff --git a/metrics/tests/location_indicator/query_test_no_image/expected.json b/metrics/tests/location_indicator/query_test_no_image/expected.json
new file mode 100644
index 0000000000..0637a088a0
--- /dev/null
+++ b/metrics/tests/location_indicator/query_test_no_image/expected.json
@@ -0,0 +1 @@
+[] \ No newline at end of file
diff --git a/metrics/tests/location_indicator/query_test_no_image/style.json b/metrics/tests/location_indicator/query_test_no_image/style.json
new file mode 100644
index 0000000000..684f5c597c
--- /dev/null
+++ b/metrics/tests/location_indicator/query_test_no_image/style.json
@@ -0,0 +1,65 @@
+{
+ "version": 8,
+ "metadata": {
+ "test": {
+ "width": 512,
+ "height": 256,
+ "operations": [
+ [
+ "addImage",
+ "puck_hat",
+ "puck_hat.png"
+ ],
+ [
+ "addImage",
+ "puck",
+ "puck.png"
+ ],
+ [
+ "addImage",
+ "puck_shadow",
+ "puck_shadow.png"
+ ]
+ ],
+ "queryGeometry": [
+ 256,
+ 128
+ ]
+ }
+ },
+ "center": [ 139.766707, 35.693055 ],
+ "zoom": 16,
+ "pitch" : 60,
+ "bearing" : 42,
+ "sources": {},
+ "layers": [
+ {
+ "id": "background",
+ "type": "background",
+ "paint": {
+ "background-color": "white"
+ }
+ },
+ {
+ "id": "puck123",
+ "type": "location-indicator",
+ "layout" : {
+ "top-image" : "puck_hat",
+ "shadow-image" : "puck_shadow"
+ },
+ "paint" : {
+ "bearing" : 45,
+ "perspective-compensation" : 1,
+ "image-tilt-displacement" : 0,
+ "location" : [ 35.693055, 139.766707, 0],
+ "accuracy-radius": 90.0,
+ "bearing-image-size" : 0.26,
+ "top-image-size" : 0.18,
+ "shadow-image-size" : 0.2,
+
+ "accuracy-radius-color": "rgba(255,0,0,0.2)",
+ "accuracy-radius-border-color": "rgba(255,0,255,0.6)"
+ }
+ }
+ ]
+}