summaryrefslogtreecommitdiff
path: root/metrics
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-04-10 12:57:46 +0300
committergalinelle <paolo.angelelli@mapbox.com>2020-04-16 11:56:02 +0300
commit545a09fcb383595f8a012a2504cd61a924ca62ac (patch)
tree499e7df03b83553ddcd7d2ae1db8253516727a0f /metrics
parent4da54d61cc7e61325e23440fc4578fefd34f52d3 (diff)
downloadqtlocation-mapboxgl-545a09fcb383595f8a012a2504cd61a924ca62ac.tar.gz
Fix LocationIndicator not updating image sizes when image manager content changes
Diffstat (limited to 'metrics')
-rw-r--r--metrics/ignores/platform-linux.json3
-rw-r--r--metrics/tests/location_indicator/change_image/expected.pngbin0 -> 12111 bytes
-rw-r--r--metrics/tests/location_indicator/change_image/style.json104
3 files changed, 106 insertions, 1 deletions
diff --git a/metrics/ignores/platform-linux.json b/metrics/ignores/platform-linux.json
index 29d06bfc3d..ec018eb805 100644
--- a/metrics/ignores/platform-linux.json
+++ b/metrics/ignores/platform-linux.json
@@ -21,5 +21,6 @@
"location_indicator/tilted_texture_shift_top_left": "Would need a different baseline when ran on llvmpipe not supporting anisotropic filtering",
"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/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"
}
diff --git a/metrics/tests/location_indicator/change_image/expected.png b/metrics/tests/location_indicator/change_image/expected.png
new file mode 100644
index 0000000000..ffd0542078
--- /dev/null
+++ b/metrics/tests/location_indicator/change_image/expected.png
Binary files differ
diff --git a/metrics/tests/location_indicator/change_image/style.json b/metrics/tests/location_indicator/change_image/style.json
new file mode 100644
index 0000000000..7aed158bc5
--- /dev/null
+++ b/metrics/tests/location_indicator/change_image/style.json
@@ -0,0 +1,104 @@
+{
+ "version": 8,
+ "metadata": {
+ "test": {
+ "width": 512,
+ "height": 256,
+ "operations": [
+ [
+ "addImage",
+ "puck_hat",
+ "puck_hat.png",
+ {"pixelRatio": 2.0}
+ ],
+ [
+ "addImage",
+ "puck",
+ "puck.png",
+ {"pixelRatio": 2.0}
+
+ ],
+ [
+ "addImage",
+ "puck_shadow",
+ "puck_shadow.png",
+ {"pixelRatio": 2.0}
+ ],
+ [ "sleep", 500 ],
+ [
+ "addImage",
+ "puck_hat",
+ "puck_hat.png",
+ {"pixelRatio": 4.0}
+ ]
+ ]
+ }
+ },
+ "sources": {
+ "geojson": {
+ "type": "geojson",
+ "data": {
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 139.766707,
+ 35.693055
+
+ ]
+ }
+ }
+ ]
+ }
+ }
+ },
+ "center": [ 139.766707, 35.693055 ],
+ "zoom": 16,
+ "pitch" : 0,
+ "bearing" : 42,
+ "layers": [
+ {
+ "id": "background",
+ "type": "background",
+ "paint": {
+ "background-color": "lightseagreen"
+ }
+ },
+ {
+ "id": "puck123",
+ "type": "circle",
+ "source": "geojson",
+ "paint": {
+ "circle-radius": 40,
+ "circle-color" : "rgba(255,0,0,0.1)"
+ }
+ },
+ {
+ "id": "puck124",
+ "type": "location-indicator",
+ "layout" : {
+ "bearing-image" : "puck",
+ "top-image" : "puck_hat",
+ "shadow-image" : "puck_shadow"
+ },
+ "paint" : {
+ "bearing" : 45,
+ "perspective-compensation" : 1,
+ "image-tilt-displacement" : 6.5,
+ "location" : [ 35.693055, 139.766707, 0],
+ "accuracy-radius": 90.0,
+ "bearing-image-size" : 0.52,
+ "top-image-size" : 0.36,
+ "shadow-image-size" : 0.4,
+
+ "accuracy-radius-color": "rgba(255,0,0,0.2)",
+ "accuracy-radius-border-color": "rgba(255,0,255,0.6)"
+ }
+ }
+ ]
+}