Skip to content

Commit

Permalink
Fix #9920 Issue editing WMS layers style on 3D view (#9922)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Jan 29, 2024
1 parent 937b3f0 commit 0ec3e1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion web/client/utils/cesium/WMSUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export function wmsToCesiumOptionsSingleTile(options) {
bbox: "-180.0,-90,180.0,90",
srs: "EPSG:4326",
...(params || {}),
...getAuthenticationParam(options)
...getAuthenticationParam(options),
...(options._v_ ? {_v_: options._v_} : {})
};

const url = (isArray(options.url) ? options.url[Math.round(Math.random() * (options.url.length - 1))] : options.url) + '?service=WMS&version=1.1.0&request=GetMap&'
Expand Down
5 changes: 3 additions & 2 deletions web/client/utils/cesium/__tests__/WMSUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ describe('Test the WMSUtil for Cesium', () => {
const options = {
type: 'wms',
url: '/geoserver/wms',
name: 'workspace:layer'
name: 'workspace:layer',
_v_: '0123456789'
};
const cesiumOptions = wmsToCesiumOptionsSingleTile(options);
expect(cesiumOptions.url.url).toBe('/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&styles=&format=image%2Fpng&transparent=true&opacity=1&TILED=true&layers=workspace%3Alayer&width=2000&height=2000&bbox=-180.0%2C-90%2C180.0%2C90&srs=EPSG%3A4326');
expect(cesiumOptions.url.url).toBe('/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&styles=&format=image%2Fpng&transparent=true&opacity=1&TILED=true&layers=workspace%3Alayer&width=2000&height=2000&bbox=-180.0%2C-90%2C180.0%2C90&srs=EPSG%3A4326&_v_=0123456789');
});
});

0 comments on commit 0ec3e1f

Please sign in to comment.