// loaders.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { parseCSWCapabilities } from "./lib/parsers/csw/parse-csw-capabilities.js"; // __VERSION__ is injected by babel-plugin-version-inline // @ts-ignore TS2304: Cannot find name '__VERSION__'. const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest'; /** * Loader for the response to the CSW GetCapability request */ export const CSWCapabilitiesLoader = { dataType: null, batchType: null, id: 'csw-capabilities', name: 'CSW Capabilities', module: 'wms', version: VERSION, worker: false, extensions: ['xml'], mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'], testText: testXMLFile, options: { csw: {} }, parse: async (arrayBuffer, options) => parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options), parseTextSync: (text, options) => parseCSWCapabilities(text, options) }; function testXMLFile(text) { // TODO - There could be space first. return text.startsWith('