Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only evaluate CrossFaded properties at integer zooms #6430

Merged
merged 4 commits into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/style-spec/reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,7 @@
"function": "piecewise-constant",
"zoom-function": true,
"transition": true,
"doc": "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).",
"doc": "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
"sdk-support": {
"basic functionality": {
"js": "0.10.0",
Expand Down Expand Up @@ -2975,7 +2975,7 @@
"function": "piecewise-constant",
"zoom-function": true,
"transition": true,
"doc": "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).",
"doc": "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
"sdk-support": {
"basic functionality": {
"js": "0.27.0",
Expand Down Expand Up @@ -3245,7 +3245,7 @@
"value": "number",
"function": "piecewise-constant",
"zoom-function": true,
"doc": "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale.",
"doc": "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
"minimum": 0,
"transition": true,
"units": "line widths",
Expand All @@ -3269,7 +3269,7 @@
"function": "piecewise-constant",
"zoom-function": true,
"transition": true,
"doc": "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).",
"doc": "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
"sdk-support": {
"basic functionality": {
"js": "0.10.0",
Expand Down Expand Up @@ -4313,7 +4313,7 @@
"function": "piecewise-constant",
"zoom-function": true,
"transition": true,
"doc": "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).",
"doc": "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
"sdk-support": {
"basic functionality": {
"js": "0.10.0",
Expand Down
6 changes: 3 additions & 3 deletions src/style/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ export class CrossFadedProperty<T> implements Property<T, ?CrossFaded<T>> {
} else {
assert(!value.isDataDriven());
return this._calculate(
value.expression.evaluate({zoom: parameters.zoom - 1.0}),
value.expression.evaluate({zoom: parameters.zoom}),
value.expression.evaluate({zoom: parameters.zoom + 1.0}),
value.expression.evaluate({zoom: Math.floor(parameters.zoom - 1.0)}),
value.expression.evaluate({zoom: Math.floor(parameters.zoom)}),
value.expression.evaluate({zoom: Math.floor(parameters.zoom + 1.0)}),
parameters);
}
}
Expand Down