// loaders.gl, MIT license // import type {WMTSCapabilities} from './lib/wmts/parse-wmts-capabilities'; import { parseWMTSCapabilities } from "./lib/wmts/parse-wmts-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 WMTS GetCapability request */ export const WMTSCapabilitiesLoader = { dataType: null, batchType: null, id: 'wmts-capabilities', name: 'WMTS Capabilities', module: 'wms', version: VERSION, worker: false, extensions: ['xml'], mimeTypes: ['application/vnd.ogc.wmts_xml', 'application/xml', 'text/xml'], testText: testXMLFile, options: { wms: {} }, parse: async (arrayBuffer, options) => parseWMTSCapabilities(new TextDecoder().decode(arrayBuffer), options), parseTextSync: (text, options) => parseWMTSCapabilities(text, options) }; function testXMLFile(text) { // TODO - There could be space first. return text.startsWith('