Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## main
### ✨ Features and improvements
- Validate that `raster` layers do not specify both `resampling` and `raster-resampling` paint properties ([#1532](https://github.com/maplibre/maplibre-style-spec/pull/1532)) (by [larsmaxfield](https://github.com/larsmaxfield))
- _...Add new stuff here..._

### 🐞 Bug fixes
Expand Down
6 changes: 3 additions & 3 deletions src/reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -7763,7 +7763,7 @@
"default": "linear",
"sdk-support": {
"basic functionality": {
"js": "https://github.com/maplibre/maplibre-gl-js/issues/7154",
"js": "5.20.0",
"android": "https://github.com/maplibre/maplibre-native/issues/4117",
"ios": "https://github.com/maplibre/maplibre-native/issues/4117"
}
Expand Down Expand Up @@ -8050,7 +8050,7 @@
"default": "linear",
"sdk-support": {
"basic functionality": {
"js": "https://github.com/maplibre/maplibre-gl-js/issues/7154",
"js": "5.20.0",
"android": "https://github.com/maplibre/maplibre-native/issues/4117",
"ios": "https://github.com/maplibre/maplibre-native/issues/4117"
}
Expand Down Expand Up @@ -8128,7 +8128,7 @@
"default": "linear",
"sdk-support": {
"basic functionality": {
"js": "https://github.com/maplibre/maplibre-gl-js/issues/7154",
"js": "5.20.0",
"android": "https://github.com/maplibre/maplibre-native/issues/4117",
"ios": "https://github.com/maplibre/maplibre-native/issues/4117"
}
Expand Down
10 changes: 10 additions & 0 deletions src/validate/validate_layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ export function validateLayer(options) {
}
}

if (type === 'raster' && layer.paint?.resampling && layer.paint?.['raster-resampling']) {
errors.push(
new ValidationError(
key,
layer.paint,
`layer "${layer.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`
)
);
}

errors = errors.concat(
validateObject({
key,
Expand Down
10 changes: 10 additions & 0 deletions test/integration/style-spec/tests/layers.input.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@
"hillshade-highlight-color": [],
"hillshade-shadow-color": []
}
},
{
"id": "redundant-resampling",
"type": "raster",
"source": "raster",
"source-layer": "source-layer",
"paint": {
"resampling": "nearest",
"raster-resampling": "linear"
}
}
]
}
4 changes: 4 additions & 0 deletions test/integration/style-spec/tests/layers.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,9 @@
{
"message": "layers[22].paint.hillshade-shadow-color: array length at least 1 expected, length 0 found",
"line": 191
},
{
"message": "layers[23]: layer \"redundant-resampling\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".",
"line": 199
}
]