summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-04-08 16:28:35 +0300
committergalinelle <paolo.angelelli@mapbox.com>2020-04-10 00:15:43 +0300
commit209857f8acc73d7950a1c8ec58f4ec7622287e55 (patch)
treea6cb095fffae224aae84e7d93dc38fbc7037d361 /scripts
parente6c156420d2d287bd6d3449af3338f550dbf84f4 (diff)
downloadqtlocation-mapboxgl-209857f8acc73d7950a1c8ec58f4ec7622287e55.tar.gz
Fix LocationIndicator Layer
This changes image size properties to be scales instead of pixel sizes. The commit also adds fixes for handling image updates with the same ID, adds tests for expressions in paint properties, as well as tests for using images with pixel ratio greater than 1. Finally it moves image-tilt-displacement and perspective-compensation properties from layout to paint properties, and includes other minor cleanups.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/style-spec.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/scripts/style-spec.js b/scripts/style-spec.js
index 15a4c7e0dc..fc16849de0 100644
--- a/scripts/style-spec.js
+++ b/scripts/style-spec.js
@@ -34,7 +34,10 @@ referenceSpec["layout_location-indicator"] = {
]
},
"doc": "Name of image in sprite to use as the background of the location indicator."
- },
+ }
+};
+
+referenceSpec["paint_location-indicator"] = {
"perspective-compensation": {
"type": "number",
"default": "0.85",
@@ -59,10 +62,7 @@ referenceSpec["layout_location-indicator"] = {
]
},
"doc": "The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence."
- }
-};
-
-referenceSpec["paint_location-indicator"] = {
+ },
"bearing": {
"type": "number",
"default": "0",
@@ -74,7 +74,7 @@ referenceSpec["paint_location-indicator"] = {
"interpolated": false,
"parameters": [ ]
},
- "transition": false,
+ "transition": true,
"doc": "The bearing of the location indicator."
},
"location": {
@@ -110,9 +110,9 @@ referenceSpec["paint_location-indicator"] = {
},
"top-image-size": {
"type": "number",
- "units": "pixels",
+ "units": "factor of the original icon size",
"property-type": "data-constant",
- "default": 0,
+ "default": 1,
"expression": {
"interpolated": true,
"parameters": [
@@ -120,13 +120,13 @@ referenceSpec["paint_location-indicator"] = {
]
},
"transition": true,
- "doc": "The size of the top image, in pixels."
+ "doc": "The size of the top image, as a scale factor applied to the size of the specified image."
},
"bearing-image-size": {
"type": "number",
- "units": "pixels",
+ "units": "factor of the original icon size",
"property-type": "data-constant",
- "default": 0,
+ "default": 1,
"expression": {
"interpolated": true,
"parameters": [
@@ -134,13 +134,13 @@ referenceSpec["paint_location-indicator"] = {
]
},
"transition": true,
- "doc": "The size of the bearing image, in pixels."
+ "doc": "The size of the bearing image, as a scale factor applied to the size of the specified image."
},
"shadow-image-size": {
"type": "number",
- "units": "pixels",
+ "units": "factor of the original icon size",
"property-type": "data-constant",
- "default": 0,
+ "default": 1,
"expression": {
"interpolated": true,
"parameters": [
@@ -148,7 +148,7 @@ referenceSpec["paint_location-indicator"] = {
]
},
"transition": true,
- "doc": "The size of the shadow image, in pixels."
+ "doc": "The size of the shadow image, as a scale factor applied to the size of the specified image."
},
"accuracy-radius-color": {
"type": "color",