Skip to content

Commit

Permalink
fix: wms example (#2814)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen authored Nov 29, 2023
1 parent bf60df8 commit 0884690
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions modules/loader-utils/src/lib/sources/image-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export type GetImageParameters = {
styles?: unknown;
/** bounding box of the requested map image */
boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];
/** @deprecated use boundingBox */
bbox?: [number, number, number, number];
/** pixel width of returned image */
width: number;
/** pixels */
Expand Down
4 changes: 2 additions & 2 deletions modules/wms/src/services/ogc/wms-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ export class WMSSource extends ImageSource<WMSSourceProps> {

async getImage(parameters: GetImageParameters): Promise<ImageType> {
// Replace the GetImage `boundingBox` parameter with the WMS flat `bbox` parameter.
const {boundingBox, ...rest} = parameters;
const {boundingBox, bbox, ...rest} = parameters;
const wmsParameters: WMSGetMapParameters = {
bbox: [...boundingBox[0], ...boundingBox[1]],
bbox: boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox!,
...rest
};
return await this.getMap(wmsParameters);
Expand Down

0 comments on commit 0884690

Please sign in to comment.