diff --git a/web/client/api/CSW.js b/web/client/api/CSW.js index dbaa3896ed..61bd62fa80 100644 --- a/web/client/api/CSW.js +++ b/web/client/api/CSW.js @@ -8,7 +8,7 @@ import urlUtil from 'url'; -import { get, head, last, template, isNil, castArray, isEmpty } from 'lodash'; +import { get, head, last, template, isNil, castArray, isEmpty, isArray } from 'lodash'; import assign from 'object-assign'; import xml2js from 'xml2js'; import axios from '../libs/ajax'; @@ -454,7 +454,15 @@ const getBboxFor3DLayersToRecords = async(result)=> { let { records } = result; if (records?.length) { let records3DPromisesForCapabilities = records.map((rec)=>{ - if (rec?.dc?.format === THREE_D_TILES) { + if (castArray(rec?.dc?.format).includes(THREE_D_TILES)) { + if (isArray(rec.dc?.URI)) { + let tilesetJsonURIs = castArray(rec.dc.URI).filter((uri) => { + return uri.protocol && uri.protocol === "OGC:3DTILES"; + }); + if (tilesetJsonURIs?.length) { + return getCapabilities(head(tilesetJsonURIs).value); + } + } let tilesetJsonURL = rec.dc?.URI?.value; return getCapabilities(tilesetJsonURL); } diff --git a/web/client/api/catalog/CSW.js b/web/client/api/catalog/CSW.js index abc788a567..c40d52ed1d 100644 --- a/web/client/api/catalog/CSW.js +++ b/web/client/api/catalog/CSW.js @@ -264,9 +264,9 @@ export const getCatalogRecords = (records, options, locales) => { }; let catRecord; - if (dc && dc.format === THREE_D_TILES) { + if (dc && castArray(dc.format).includes(THREE_D_TILES)) { catRecord = getCatalogRecord3DTiles(record, metadata); - } else if (dc && dc.format === MODEL) { + } else if (dc && castArray(dc.format).includes(MODEL)) { // todo: handle get catalog record for ifc } else { const layerType = Object.keys(parsedReferences).filter(key => !ADDITIONAL_OGC_SERVICES.includes(key)).find(key => parsedReferences[key]);