diff --git a/CHANGELOG.md b/CHANGELOG.md index 7061e60b6..4f56637be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/reference/v8.json b/src/reference/v8.json index d93b13e8a..36954550a 100644 --- a/src/reference/v8.json +++ b/src/reference/v8.json @@ -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" } @@ -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" } @@ -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" } diff --git a/src/validate/validate_layer.ts b/src/validate/validate_layer.ts index 55482ac39..3fac7717e 100644 --- a/src/validate/validate_layer.ts +++ b/src/validate/validate_layer.ts @@ -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, diff --git a/test/integration/style-spec/tests/layers.input.json b/test/integration/style-spec/tests/layers.input.json index d2f1295e2..fc8a2adf0 100644 --- a/test/integration/style-spec/tests/layers.input.json +++ b/test/integration/style-spec/tests/layers.input.json @@ -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" + } } ] } diff --git a/test/integration/style-spec/tests/layers.output.json b/test/integration/style-spec/tests/layers.output.json index 2104c0afc..ceb44b67c 100644 --- a/test/integration/style-spec/tests/layers.output.json +++ b/test/integration/style-spec/tests/layers.output.json @@ -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 } ]