Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #413 from mapbox/ramp-validation
Browse files Browse the repository at this point in the history
Revert "prevent ramp from having duplicate stops"
  • Loading branch information
scothis committed Feb 5, 2016
2 parents ef23dd1 + 2ced510 commit 79d7bfd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 33 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## master

* Revert ramp validation checks that broke some styles.

## 8.4.0

v8.0.0 styles are fully compatible with v8.4.0.
Expand Down
4 changes: 2 additions & 2 deletions lib/validate/parsed.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ module.exports = function(style, reference) {
error(key + '[0]', val[0], 'zoom level for piecewise-constant functions must be an integer');
}

if (val[0] <= lastStop) {
error(key + '[0]', val[0], 'array stops must appear in ascending order and have no duplicates');
if (val[0] < lastStop) {
error(key + '[0]', val[0], 'array stops must appear in ascending order');
}

lastStop = val[0];
Expand Down
20 changes: 0 additions & 20 deletions test/fixture/functions.input.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,6 @@
}
}
},
{
"id": "duplicate-stop",
"type": "line",
"source": "source",
"source-layer": "layer",
"paint": {
"line-width": {
"stops": [
[
1,
0
],
[
1,
0
]
]
}
}
},
{
"id": "v6-array-function",
"type": "fill",
Expand Down
18 changes: 7 additions & 11 deletions test/fixture/functions.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,19 @@
"line": 102
},
{
"message": "layers[8].paint.line-width.stops[1][0]: array stops must appear in ascending order and have no duplicates",
"message": "layers[8].paint.line-width.stops[1][0]: array stops must appear in ascending order",
"line": 121
},
{
"message": "layers[9].paint.line-width.stops[1][0]: array stops must appear in ascending order and have no duplicates",
"line": 141
"message": "layers[9].paint.fill-translate[0]: number expected, object found",
"line": 135
},
{
"message": "layers[10].paint.fill-translate[0]: number expected, object found",
"line": 155
"message": "layers[9].paint.fill-translate[1]: number expected, object found",
"line": 139
},
{
"message": "layers[10].paint.fill-translate[1]: number expected, object found",
"line": 159
},
{
"message": "layers[12].paint.fill-antialias.stops[0][0]: zoom level for piecewise-constant functions must be an integer",
"line": 185
"message": "layers[11].paint.fill-antialias.stops[0][0]: zoom level for piecewise-constant functions must be an integer",
"line": 165
}
]

0 comments on commit 79d7bfd

Please sign in to comment.