Skip to content

Commit 568dccd

Browse files
authored
Remove resampling validation logic for raster layers (#7224)
* Remove resampling validation logic in raster layer Style spec v24.7.0 now validates redundant properties * Update maplibre-style-spec version to 24.7.0 * Update package-lock.json
1 parent 46cc6c9 commit 568dccd

File tree

4 files changed

+5
-25
lines changed

4 files changed

+5
-25
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@mapbox/vector-tile": "^2.0.4",
2525
"@mapbox/whoots-js": "^3.1.0",
2626
"@maplibre/geojson-vt": "^6.0.1",
27-
"@maplibre/maplibre-gl-style-spec": "^24.6.0",
27+
"@maplibre/maplibre-gl-style-spec": "^24.7.0",
2828
"@maplibre/mlt": "^1.1.6",
2929
"@maplibre/vt-pbf": "^4.3.0",
3030
"@types/geojson": "^7946.0.16",

src/style/style_layer/raster_style_layer.test.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,4 @@ describe('RasterStyleLayer correctly handles "resampling" and "raster-resampling
2929
expect(resampling).toEqual(undefined);
3030
});
3131

32-
test('warns when both "resampling" and "raster-resampling" are specified upon instantiation', () => {
33-
const originalWarn = console.warn;
34-
console.warn = vi.fn();
35-
36-
const layerSpec = createLayerSpec({
37-
paint: {
38-
resampling: 'nearest',
39-
'raster-resampling': 'nearest',
40-
}
41-
});
42-
createStyleLayer(layerSpec, {});
43-
expect(console.warn).toHaveBeenCalledTimes(1);
44-
console.warn = originalWarn;
45-
});
46-
4732
});

src/style/style_layer/raster_style_layer.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {StyleLayer} from '../style_layer';
2-
import {warnOnce} from '../../util/util';
32

43
import properties, {type RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties.g';
54
import {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';
@@ -15,10 +14,6 @@ export class RasterStyleLayer extends StyleLayer {
1514
paint: PossiblyEvaluated<RasterPaintProps, RasterPaintPropsPossiblyEvaluated>;
1615

1716
constructor(layer: LayerSpecification, globalState: Record<string, any>) {
18-
const resampling = layer.paint?.['resampling'];
19-
if (resampling && layer.paint?.['raster-resampling']) {
20-
warnOnce(`Raster layer "${layer.id}" paint properties "resampling" and "raster-resampling" are both specified, but only "resampling" needs to be specified. Defaulting to "resampling" (${resampling}).`);
21-
}
2217
super(layer, properties, globalState);
2318
}
2419
}

0 commit comments

Comments
 (0)