Skip to content

Commit

Permalink
fix displaying WMS layers from data.geopf.fr in 3d mode (geosolutions…
Browse files Browse the repository at this point in the history
…-it#10592)

data.geopf.fr only supports WMS 1.3.0. Cesium defaults to 1.1.1.
Pass the version from the options, and default to 1.1.1 if unset.
  • Loading branch information
landryb committed Dec 31, 2024
1 parent d1ebec1 commit d009bad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/client/utils/cesium/WMSUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export function wmsToCesiumOptions(options) {
format: isVectorFormat(options.format) && 'image/png' || options.format || 'image/png',
transparent: options.transparent !== undefined ? options.transparent : true,
opacity: opacity,
version: options.version || "1.1.1",
tiled: options.tiled !== undefined ? options.tiled : true,
width: options.tileSize || 256,
height: options.tileSize || 256,
Expand Down
11 changes: 11 additions & 0 deletions web/client/utils/cesium/__tests__/WMSUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe('Test the WMSUtil for Cesium', () => {
expect(cesiumOptions.layers).toBe('workspace:layer');
expect(cesiumOptions.parameters).toEqual({
styles: '',
version: '1.1.1',
format: 'image/png',
transparent: true,
opacity: 1,
Expand All @@ -64,6 +65,16 @@ describe('Test the WMSUtil for Cesium', () => {
height: 256
});
});
it('wmsToCesiumOptions with version', () => {
const options = {
type: 'wms',
version: '1.3.0',
url: '/geoserver/wms',
name: 'workspace:layer'
};
const cesiumOptions = wmsToCesiumOptions(options);
expect(cesiumOptions.parameters.version).toBe('1.3.0');
});
it('wmsToCesiumOptionsSingleTile', () => {
const options = {
type: 'wms',
Expand Down

0 comments on commit d009bad

Please sign in to comment.