diff --git a/web/client/utils/ogc/WMC/index.js b/web/client/utils/ogc/WMC/index.js index 37746ec566..4e1da57a37 100644 --- a/web/client/utils/ogc/WMC/index.js +++ b/web/client/utils/ogc/WMC/index.js @@ -7,7 +7,7 @@ */ import { Parser } from 'xml2js'; -import { keys, values, get, head, mapValues, uniqWith, findIndex, pick, has, toPairs, castArray } from 'lodash'; +import { keys, values, get, head, mapValues, uniqWith, findIndex, pick, has, toPairs, castArray, isEmpty } from 'lodash'; import { v1 as uuidv1 } from 'uuid'; import { @@ -391,8 +391,7 @@ export const toWMC = ( }) }; }; - - const olExtensionsGeneral = assignNamespace([{ + const olExtensionsGeneral = isEmpty(maxExtent) ? [] : assignNamespace([{ name: 'maxExtent', attributes: objectToAttributes({ minx: maxExtent[0], @@ -629,7 +628,7 @@ export const toWMC = ( attributes: objectToAttributes(isValidBboxObject(bbox) ? { ...bbox.bounds, SRS: bbox.crs - } : { + } : isEmpty(maxExtent) ? {} : { minx: maxExtent[0], miny: maxExtent[1], maxx: maxExtent[2],