@loaders.gl/wms 4.0.0-alpha.23 → 4.0.0-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es5/csw-capabilities-loader.js +1 -1
- package/dist/es5/csw-domain-loader.js +1 -1
- package/dist/es5/csw-records-loader.js +1 -1
- package/dist/es5/gml-loader.js +1 -1
- package/dist/es5/gml-loader.js.map +1 -1
- package/dist/es5/lerc-loader.js +1 -1
- package/dist/es5/lerc-loader.js.map +1 -1
- package/dist/es5/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
- package/dist/es5/wms-capabilities-loader.js +1 -1
- package/dist/es5/wms-error-loader.js +1 -1
- package/dist/esm/csw-capabilities-loader.js +1 -1
- package/dist/esm/csw-domain-loader.js +1 -1
- package/dist/esm/csw-records-loader.js +1 -1
- package/dist/esm/gml-loader.js +1 -1
- package/dist/esm/gml-loader.js.map +1 -1
- package/dist/esm/lerc-loader.js +1 -1
- package/dist/esm/lerc-loader.js.map +1 -1
- package/dist/esm/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
- package/dist/esm/wms-capabilities-loader.js +1 -1
- package/dist/esm/wms-error-loader.js +1 -1
- package/dist/gml-loader.d.ts +2 -1
- package/dist/gml-loader.d.ts.map +1 -1
- package/dist/lerc-loader.d.ts +2 -1
- package/dist/lerc-loader.d.ts.map +1 -1
- package/dist/lib/parsers/gml/parse-gml.d.ts +1 -0
- package/dist/lib/parsers/gml/parse-gml.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/gml-loader.ts +2 -1
- package/src/lerc-loader.ts +1 -1
- package/src/lib/parsers/gml/parse-gml.ts +2 -0
- package/dist/bundle.js +0 -6
- package/dist/csw-capabilities-loader.js +0 -30
- package/dist/csw-domain-loader.js +0 -30
- package/dist/csw-records-loader.js +0 -30
- package/dist/gml-loader.js +0 -30
- package/dist/index.js +0 -39
- package/dist/lerc-loader.js +0 -55
- package/dist/lib/create-image-source.js +0 -39
- package/dist/lib/parsers/csw/parse-csw-capabilities.js +0 -24
- package/dist/lib/parsers/csw/parse-csw-domain.js +0 -33
- package/dist/lib/parsers/csw/parse-csw-records.js +0 -58
- package/dist/lib/parsers/csw/parse-exception-report.js +0 -30
- package/dist/lib/parsers/gml/deep-strict-equal.js +0 -119
- package/dist/lib/parsers/gml/parse-gml.js +0 -371
- package/dist/lib/parsers/lerc/lerc-types.js +0 -3
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +0 -233
- package/dist/lib/parsers/wms/parse-wms-error.js +0 -22
- package/dist/lib/parsers/wms/parse-wms-features.js +0 -27
- package/dist/lib/parsers/wms/parse-wms-layer-description.js +0 -15
- package/dist/lib/parsers/xml/parse-xml-helpers.js +0 -68
- package/dist/lib/services/arcgis/arcgis-image-service.js +0 -94
- package/dist/lib/services/arcgis/arcgis-server.js +0 -42
- package/dist/lib/services/generic/image-service.js +0 -47
- package/dist/lib/services/ogc/csw-service.js +0 -168
- package/dist/lib/services/ogc/wms-service.js +0 -309
- package/dist/lib/sources/data-source.js +0 -56
- package/dist/lib/sources/image-source.js +0 -13
- package/dist/lib/sources/tile-source.js +0 -13
- package/dist/lib/sources/utils/utils.js +0 -38
- package/dist/lib/wfs/parse-wfs.js +0 -32
- package/dist/lib/wmts/parse-wmts.js +0 -35
- package/dist/wip/arcgis-feature-service.js +0 -28
- package/dist/wip/data-source.js +0 -59
- package/dist/wip/lib/wcs/parse-wcs-capabilities.js +0 -15
- package/dist/wip/lib/wfs/parse-wfs-capabilities.js +0 -19
- package/dist/wip/lib/wmts/parse-wmts-capabilities.js +0 -77
- package/dist/wip/wcs-capabilities-loader.js +0 -31
- package/dist/wip/wfs-capabilities-loader.js +0 -31
- package/dist/wip/wms-feature-info-loader.js +0 -18
- package/dist/wip/wms-layer-description-loader.js +0 -17
- package/dist/wip/wmts-capabilities-loader.js +0 -32
- package/dist/wms-capabilities-loader.js +0 -34
- package/dist/wms-error-loader.js +0 -42
package/dist/gml-loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gml-loader.d.ts","sourceRoot":"","sources":["../src/gml-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"gml-loader.d.ts","sourceRoot":"","sources":["../src/gml-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAO1D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,EAAE,CAAC;CACV,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,gBAAgB,CAgBhF,CAAC"}
|
package/dist/lerc-loader.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { LERCData } from './lib/parsers/lerc/lerc-types';
|
|
2
3
|
export type LERCLoaderOptions = LoaderOptions & {
|
|
3
4
|
lerc?: {
|
|
4
5
|
/** The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */
|
|
@@ -12,5 +13,5 @@ export type LERCLoaderOptions = LoaderOptions & {
|
|
|
12
13
|
/**
|
|
13
14
|
* Loader for the LERC raster format
|
|
14
15
|
*/
|
|
15
|
-
export declare const LERCLoader: LoaderWithParser
|
|
16
|
+
export declare const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions>;
|
|
16
17
|
//# sourceMappingURL=lerc-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lerc-loader.d.ts","sourceRoot":"","sources":["../src/lerc-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"lerc-loader.d.ts","sourceRoot":"","sources":["../src/lerc-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAO5D,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,IAAI,CAAC,EAAE;QACL,4GAA4G;QAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gFAAgF;QAChF,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gFAAgF;QAChF,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,iBAAiB,CAe3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-gml.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/gml/parse-gml.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAIV,QAAQ,EACR,QAAQ,EAST,MAAM,oBAAoB,CAAC;AAU5B,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/wms",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.24",
|
|
4
4
|
"description": "Framework-independent loaders for the WMS (Web Map Service) standard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/runtime": "^7.3.1",
|
|
42
|
-
"@loaders.gl/images": "4.0.0-alpha.
|
|
43
|
-
"@loaders.gl/loader-utils": "4.0.0-alpha.
|
|
44
|
-
"@loaders.gl/schema": "4.0.0-alpha.
|
|
45
|
-
"@loaders.gl/xml": "4.0.0-alpha.
|
|
42
|
+
"@loaders.gl/images": "4.0.0-alpha.24",
|
|
43
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.24",
|
|
44
|
+
"@loaders.gl/schema": "4.0.0-alpha.24",
|
|
45
|
+
"@loaders.gl/xml": "4.0.0-alpha.24",
|
|
46
46
|
"@turf/rewind": "^5.1.5",
|
|
47
47
|
"deep-strict-equal": "^0.2.0",
|
|
48
48
|
"lerc": "^4.0.1"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "97a8990595c132fb14e3445a8768d9f4cb98ff05"
|
|
51
51
|
}
|
package/src/gml-loader.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// loaders.gl, MIT license
|
|
2
2
|
|
|
3
3
|
import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
|
|
4
|
+
import type {Geometry} from './lib/parsers/gml/parse-gml';
|
|
4
5
|
import {parseGML} from './lib/parsers/gml/parse-gml';
|
|
5
6
|
|
|
6
7
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
@@ -14,7 +15,7 @@ export type GMLLoaderOptions = LoaderOptions & {
|
|
|
14
15
|
/**
|
|
15
16
|
* Loader for the response to the GML GetCapability request
|
|
16
17
|
*/
|
|
17
|
-
export const GMLLoader: LoaderWithParser = {
|
|
18
|
+
export const GMLLoader: LoaderWithParser<Geometry | null, never, GMLLoaderOptions> = {
|
|
18
19
|
name: 'GML',
|
|
19
20
|
id: 'gml',
|
|
20
21
|
|
package/src/lerc-loader.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type LERCLoaderOptions = LoaderOptions & {
|
|
|
22
22
|
/**
|
|
23
23
|
* Loader for the LERC raster format
|
|
24
24
|
*/
|
|
25
|
-
export const LERCLoader: LoaderWithParser = {
|
|
25
|
+
export const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions> = {
|
|
26
26
|
id: 'lerc',
|
|
27
27
|
name: 'LERC',
|
|
28
28
|
|
package/dist/bundle.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CSWCapabilitiesLoader = void 0;
|
|
5
|
-
const parse_csw_capabilities_1 = require("./lib/parsers/csw/parse-csw-capabilities");
|
|
6
|
-
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
-
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
9
|
-
/**
|
|
10
|
-
* Loader for the response to the CSW GetCapability request
|
|
11
|
-
*/
|
|
12
|
-
exports.CSWCapabilitiesLoader = {
|
|
13
|
-
id: 'csw-capabilities',
|
|
14
|
-
name: 'CSW Capabilities',
|
|
15
|
-
module: 'wms',
|
|
16
|
-
version: VERSION,
|
|
17
|
-
worker: false,
|
|
18
|
-
extensions: ['xml'],
|
|
19
|
-
mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],
|
|
20
|
-
testText: testXMLFile,
|
|
21
|
-
options: {
|
|
22
|
-
csw: {}
|
|
23
|
-
},
|
|
24
|
-
parse: async (arrayBuffer, options) => (0, parse_csw_capabilities_1.parseCSWCapabilities)(new TextDecoder().decode(arrayBuffer), options),
|
|
25
|
-
parseTextSync: (text, options) => (0, parse_csw_capabilities_1.parseCSWCapabilities)(text, options)
|
|
26
|
-
};
|
|
27
|
-
function testXMLFile(text) {
|
|
28
|
-
// TODO - There could be space first.
|
|
29
|
-
return text.startsWith('<?xml');
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CSWDomainLoader = void 0;
|
|
5
|
-
const parse_csw_domain_1 = require("./lib/parsers/csw/parse-csw-domain");
|
|
6
|
-
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
-
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
9
|
-
/**
|
|
10
|
-
* Loader for the response to the CSW GetCapability request
|
|
11
|
-
*/
|
|
12
|
-
exports.CSWDomainLoader = {
|
|
13
|
-
id: 'csw-domain',
|
|
14
|
-
name: 'CSW Domain',
|
|
15
|
-
module: 'wms',
|
|
16
|
-
version: VERSION,
|
|
17
|
-
worker: false,
|
|
18
|
-
extensions: ['xml'],
|
|
19
|
-
mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],
|
|
20
|
-
testText: testXMLFile,
|
|
21
|
-
options: {
|
|
22
|
-
csw: {}
|
|
23
|
-
},
|
|
24
|
-
parse: async (arrayBuffer, options) => (0, parse_csw_domain_1.parseCSWDomain)(new TextDecoder().decode(arrayBuffer), options),
|
|
25
|
-
parseTextSync: (text, options) => (0, parse_csw_domain_1.parseCSWDomain)(text, options)
|
|
26
|
-
};
|
|
27
|
-
function testXMLFile(text) {
|
|
28
|
-
// TODO - There could be space first.
|
|
29
|
-
return text.startsWith('<?xml');
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CSWRecordsLoader = void 0;
|
|
5
|
-
const parse_csw_records_1 = require("./lib/parsers/csw/parse-csw-records");
|
|
6
|
-
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
-
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
9
|
-
/**
|
|
10
|
-
* Loader for the response to the CSW GetCapability request
|
|
11
|
-
*/
|
|
12
|
-
exports.CSWRecordsLoader = {
|
|
13
|
-
id: 'csw-records',
|
|
14
|
-
name: 'CSW Records',
|
|
15
|
-
module: 'wms',
|
|
16
|
-
version: VERSION,
|
|
17
|
-
worker: false,
|
|
18
|
-
extensions: ['xml'],
|
|
19
|
-
mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],
|
|
20
|
-
testText: testXMLFile,
|
|
21
|
-
options: {
|
|
22
|
-
csw: {}
|
|
23
|
-
},
|
|
24
|
-
parse: async (arrayBuffer, options) => (0, parse_csw_records_1.parseCSWRecords)(new TextDecoder().decode(arrayBuffer), options),
|
|
25
|
-
parseTextSync: (text, options) => (0, parse_csw_records_1.parseCSWRecords)(text, options)
|
|
26
|
-
};
|
|
27
|
-
function testXMLFile(text) {
|
|
28
|
-
// TODO - There could be space first.
|
|
29
|
-
return text.startsWith('<?xml');
|
|
30
|
-
}
|
package/dist/gml-loader.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.GMLLoader = void 0;
|
|
5
|
-
const parse_gml_1 = require("./lib/parsers/gml/parse-gml");
|
|
6
|
-
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
-
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
9
|
-
/**
|
|
10
|
-
* Loader for the response to the GML GetCapability request
|
|
11
|
-
*/
|
|
12
|
-
exports.GMLLoader = {
|
|
13
|
-
name: 'GML',
|
|
14
|
-
id: 'gml',
|
|
15
|
-
module: 'wms',
|
|
16
|
-
version: VERSION,
|
|
17
|
-
worker: false,
|
|
18
|
-
extensions: ['xml'],
|
|
19
|
-
mimeTypes: ['application/vnd.ogc.gml', 'application/xml', 'text/xml'],
|
|
20
|
-
testText: testXMLFile,
|
|
21
|
-
options: {
|
|
22
|
-
gml: {}
|
|
23
|
-
},
|
|
24
|
-
parse: async (arrayBuffer, options) => (0, parse_gml_1.parseGML)(new TextDecoder().decode(arrayBuffer), options),
|
|
25
|
-
parseTextSync: (text, options) => (0, parse_gml_1.parseGML)(text, options)
|
|
26
|
-
};
|
|
27
|
-
function testXMLFile(text) {
|
|
28
|
-
// TODO - There could be space first.
|
|
29
|
-
return text.startsWith('<?xml');
|
|
30
|
-
}
|
package/dist/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports._ArcGISImageServer = exports._getArcGISServices = exports.WMSService = exports.CSWService = exports.ImageService = exports.createImageSource = exports.ImageSource = exports._GMLLoader = exports._WFSCapabilitiesLoader = exports._WMSLayerDescriptionLoader = exports._WMSFeatureInfoLoader = exports.WMSCapabilitiesLoader = exports.WMSErrorLoader = exports.CSWRecordsLoader = exports.CSWDomainLoader = exports.CSWCapabilitiesLoader = void 0;
|
|
5
|
-
var csw_capabilities_loader_1 = require("./csw-capabilities-loader");
|
|
6
|
-
Object.defineProperty(exports, "CSWCapabilitiesLoader", { enumerable: true, get: function () { return csw_capabilities_loader_1.CSWCapabilitiesLoader; } });
|
|
7
|
-
var csw_domain_loader_1 = require("./csw-domain-loader");
|
|
8
|
-
Object.defineProperty(exports, "CSWDomainLoader", { enumerable: true, get: function () { return csw_domain_loader_1.CSWDomainLoader; } });
|
|
9
|
-
var csw_records_loader_1 = require("./csw-records-loader");
|
|
10
|
-
Object.defineProperty(exports, "CSWRecordsLoader", { enumerable: true, get: function () { return csw_records_loader_1.CSWRecordsLoader; } });
|
|
11
|
-
// WMS - Web Map Service
|
|
12
|
-
var wms_error_loader_1 = require("./wms-error-loader");
|
|
13
|
-
Object.defineProperty(exports, "WMSErrorLoader", { enumerable: true, get: function () { return wms_error_loader_1.WMSErrorLoader; } });
|
|
14
|
-
var wms_capabilities_loader_1 = require("./wms-capabilities-loader");
|
|
15
|
-
Object.defineProperty(exports, "WMSCapabilitiesLoader", { enumerable: true, get: function () { return wms_capabilities_loader_1.WMSCapabilitiesLoader; } });
|
|
16
|
-
var wms_feature_info_loader_1 = require("./wip/wms-feature-info-loader");
|
|
17
|
-
Object.defineProperty(exports, "_WMSFeatureInfoLoader", { enumerable: true, get: function () { return wms_feature_info_loader_1.WMSFeatureInfoLoader; } });
|
|
18
|
-
var wms_layer_description_loader_1 = require("./wip/wms-layer-description-loader");
|
|
19
|
-
Object.defineProperty(exports, "_WMSLayerDescriptionLoader", { enumerable: true, get: function () { return wms_layer_description_loader_1.WMSLayerDescriptionLoader; } });
|
|
20
|
-
var wfs_capabilities_loader_1 = require("./wip/wfs-capabilities-loader");
|
|
21
|
-
Object.defineProperty(exports, "_WFSCapabilitiesLoader", { enumerable: true, get: function () { return wfs_capabilities_loader_1.WFSCapabilitiesLoader; } });
|
|
22
|
-
var gml_loader_1 = require("./gml-loader");
|
|
23
|
-
Object.defineProperty(exports, "_GMLLoader", { enumerable: true, get: function () { return gml_loader_1.GMLLoader; } });
|
|
24
|
-
var image_source_1 = require("./lib/sources/image-source");
|
|
25
|
-
Object.defineProperty(exports, "ImageSource", { enumerable: true, get: function () { return image_source_1.ImageSource; } });
|
|
26
|
-
var create_image_source_1 = require("./lib/create-image-source");
|
|
27
|
-
Object.defineProperty(exports, "createImageSource", { enumerable: true, get: function () { return create_image_source_1.createImageSource; } });
|
|
28
|
-
var image_service_1 = require("./lib/services/generic/image-service");
|
|
29
|
-
Object.defineProperty(exports, "ImageService", { enumerable: true, get: function () { return image_service_1.ImageService; } });
|
|
30
|
-
// OGC Services
|
|
31
|
-
var csw_service_1 = require("./lib/services/ogc/csw-service");
|
|
32
|
-
Object.defineProperty(exports, "CSWService", { enumerable: true, get: function () { return csw_service_1.CSWService; } });
|
|
33
|
-
var wms_service_1 = require("./lib/services/ogc/wms-service");
|
|
34
|
-
Object.defineProperty(exports, "WMSService", { enumerable: true, get: function () { return wms_service_1.WMSService; } });
|
|
35
|
-
// ArcGIS Services
|
|
36
|
-
var arcgis_server_1 = require("./lib/services/arcgis/arcgis-server");
|
|
37
|
-
Object.defineProperty(exports, "_getArcGISServices", { enumerable: true, get: function () { return arcgis_server_1.getArcGISServices; } });
|
|
38
|
-
var arcgis_image_service_1 = require("./lib/services/arcgis/arcgis-image-service");
|
|
39
|
-
Object.defineProperty(exports, "_ArcGISImageServer", { enumerable: true, get: function () { return arcgis_image_service_1.ArcGISImageServer; } });
|
package/dist/lerc-loader.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.LERCLoader = void 0;
|
|
28
|
-
const Lerc = __importStar(require("lerc"));
|
|
29
|
-
// __VERSION__ is injected by babel-plugin-version-inline
|
|
30
|
-
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
31
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
32
|
-
/**
|
|
33
|
-
* Loader for the LERC raster format
|
|
34
|
-
*/
|
|
35
|
-
exports.LERCLoader = {
|
|
36
|
-
id: 'lerc',
|
|
37
|
-
name: 'LERC',
|
|
38
|
-
module: 'wms',
|
|
39
|
-
version: VERSION,
|
|
40
|
-
worker: false,
|
|
41
|
-
extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],
|
|
42
|
-
mimeTypes: ['application/octet-stream'],
|
|
43
|
-
// test: ?,
|
|
44
|
-
options: {
|
|
45
|
-
wms: {}
|
|
46
|
-
},
|
|
47
|
-
parse: async (arrayBuffer, options) => parseLERC(arrayBuffer, options)
|
|
48
|
-
};
|
|
49
|
-
async function parseLERC(arrayBuffer, options) {
|
|
50
|
-
// Load the WASM library
|
|
51
|
-
await Lerc.load();
|
|
52
|
-
// Perform the decode
|
|
53
|
-
const pixelBlock = Lerc.decode(arrayBuffer, options?.lerc);
|
|
54
|
-
return pixelBlock;
|
|
55
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createImageSource = void 0;
|
|
5
|
-
const image_service_1 = require("./services/generic/image-service");
|
|
6
|
-
const wms_service_1 = require("./services/ogc/wms-service");
|
|
7
|
-
const arcgis_image_service_1 = require("./services/arcgis/arcgis-image-service");
|
|
8
|
-
const SERVICES = [wms_service_1.WMSService, arcgis_image_service_1.ArcGISImageServer, image_service_1.ImageService];
|
|
9
|
-
/**
|
|
10
|
-
* Creates an image source
|
|
11
|
-
* If type is not supplied, will try to automatically detect the the
|
|
12
|
-
* @param url URL to the image source
|
|
13
|
-
* @param type type of source. if not known, set to 'auto'
|
|
14
|
-
* @returns an ImageSource instance
|
|
15
|
-
*/
|
|
16
|
-
function createImageSource(props) {
|
|
17
|
-
const { type = 'auto' } = props;
|
|
18
|
-
const serviceType = type === 'auto' ? guessServiceType(props.url) : type;
|
|
19
|
-
switch (serviceType) {
|
|
20
|
-
case 'template':
|
|
21
|
-
return new image_service_1.ImageService(props);
|
|
22
|
-
case 'wms':
|
|
23
|
-
return new wms_service_1.WMSService(props);
|
|
24
|
-
default:
|
|
25
|
-
// currently only wms service supported
|
|
26
|
-
throw new Error('Not a valid image source type');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.createImageSource = createImageSource;
|
|
30
|
-
/** Guess service type from URL */
|
|
31
|
-
function guessServiceType(url) {
|
|
32
|
-
for (const Service of SERVICES) {
|
|
33
|
-
if (Service.testURL && Service.testURL(url)) {
|
|
34
|
-
return Service.type;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// If all else fails, guess that this is MS service
|
|
38
|
-
return 'wms';
|
|
39
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.parseCSWCapabilities = void 0;
|
|
5
|
-
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
-
const parse_exception_report_1 = require("./parse-exception-report");
|
|
7
|
-
/**
|
|
8
|
-
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
9
|
-
* @note Error handlings is fairly weak
|
|
10
|
-
*/
|
|
11
|
-
function parseCSWCapabilities(text, options) {
|
|
12
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, {
|
|
13
|
-
...options,
|
|
14
|
-
xml: {
|
|
15
|
-
...options?.xml,
|
|
16
|
-
removeNSPrefix: true,
|
|
17
|
-
uncapitalizeKeys: true
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
(0, parse_exception_report_1.parseExceptionReport)(parsedXML);
|
|
21
|
-
const xmlCapabilities = parsedXML.capabilities || parsedXML;
|
|
22
|
-
return xmlCapabilities;
|
|
23
|
-
}
|
|
24
|
-
exports.parseCSWCapabilities = parseCSWCapabilities;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.parseCSWDomain = void 0;
|
|
5
|
-
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
-
const parse_exception_report_1 = require("./parse-exception-report");
|
|
7
|
-
/**
|
|
8
|
-
* Parses a typed data structure from raw XML for `GetDomain` response
|
|
9
|
-
* @note Error handlings is fairly weak
|
|
10
|
-
*/
|
|
11
|
-
function parseCSWDomain(text, options) {
|
|
12
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, {
|
|
13
|
-
...options,
|
|
14
|
-
xml: {
|
|
15
|
-
...options?.xml,
|
|
16
|
-
removeNSPrefix: true,
|
|
17
|
-
uncapitalizeKeys: true,
|
|
18
|
-
arrayPaths: [
|
|
19
|
-
'GetDomainResponse.DomainValues',
|
|
20
|
-
'GetDomainResponse.DomainValues.ListOfValues.value'
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
(0, parse_exception_report_1.parseExceptionReport)(parsedXML);
|
|
25
|
-
const xmlDomain = parsedXML.getDomainResponse;
|
|
26
|
-
for (const domainValue of xmlDomain.domainValues) {
|
|
27
|
-
// Drop the nested <listOfValues><value><value><listOfValues> => values[]
|
|
28
|
-
domainValue.values = domainValue.listOfValues?.value;
|
|
29
|
-
delete domainValue.listOfValues;
|
|
30
|
-
}
|
|
31
|
-
return xmlDomain;
|
|
32
|
-
}
|
|
33
|
-
exports.parseCSWDomain = parseCSWDomain;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.renameXMLTags = exports.parseCSWRecords = void 0;
|
|
5
|
-
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
-
const xml_2 = require("@loaders.gl/xml");
|
|
7
|
-
const parse_exception_report_1 = require("./parse-exception-report");
|
|
8
|
-
/**
|
|
9
|
-
* Parses a typed data structure from raw XML for `GetRecords` response
|
|
10
|
-
* @note Error handlings is fairly weak
|
|
11
|
-
*/
|
|
12
|
-
function parseCSWRecords(text, options) {
|
|
13
|
-
const parsedXML = xml_2.XMLLoader.parseTextSync?.(text, {
|
|
14
|
-
...options,
|
|
15
|
-
xml: {
|
|
16
|
-
...options?.xml,
|
|
17
|
-
removeNSPrefix: true,
|
|
18
|
-
uncapitalizeKeys: true,
|
|
19
|
-
arrayPaths: [],
|
|
20
|
-
_fastXML: {
|
|
21
|
-
...options?.xml?._fastXML,
|
|
22
|
-
parseAttributeValue: true
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
(0, parse_exception_report_1.parseExceptionReport)(parsedXML);
|
|
27
|
-
const xmlRecords = parsedXML.getRecordsResponse;
|
|
28
|
-
// Move results to top
|
|
29
|
-
const elementSet = xmlRecords.searchResults.elementSet;
|
|
30
|
-
const recordsFieldName = `${elementSet}Record`;
|
|
31
|
-
xmlRecords.records = xmlRecords.searchResults[recordsFieldName];
|
|
32
|
-
delete xmlRecords.searchResults[recordsFieldName];
|
|
33
|
-
(0, xml_1.convertXMLFieldToArrayInPlace)(xmlRecords, 'records');
|
|
34
|
-
for (const record of xmlRecords.records) {
|
|
35
|
-
record.boundingBoxes = record.boundingBox;
|
|
36
|
-
delete record.boundingBox;
|
|
37
|
-
(0, xml_1.convertXMLFieldToArrayInPlace)(record, 'boundingBoxes');
|
|
38
|
-
for (const boundingBox of record.boundingBoxes) {
|
|
39
|
-
boundingBox.value = [
|
|
40
|
-
boundingBox.upperCorner[0],
|
|
41
|
-
boundingBox.upperCorner[1],
|
|
42
|
-
boundingBox.lowerCorner[0],
|
|
43
|
-
boundingBox.lowerCorner[1]
|
|
44
|
-
];
|
|
45
|
-
delete boundingBox.upperCorner;
|
|
46
|
-
delete boundingBox.lowerCorner;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return xmlRecords;
|
|
50
|
-
}
|
|
51
|
-
exports.parseCSWRecords = parseCSWRecords;
|
|
52
|
-
function renameXMLTags(xml, renameKeys) {
|
|
53
|
-
for (const [oldKey, newKey] of Object.entries(renameKeys)) {
|
|
54
|
-
xml[newKey] = xml[oldKey];
|
|
55
|
-
delete xml[oldKey];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.renameXMLTags = renameXMLTags;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.parseExceptionReport = void 0;
|
|
5
|
-
// import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
6
|
-
// import {XMLLoader} from '@loaders.gl/xml';
|
|
7
|
-
/**
|
|
8
|
-
* Parses a typed data structure from raw XML for `GetDomain` response
|
|
9
|
-
* @note Error handlings is fairly weak
|
|
10
|
-
*/
|
|
11
|
-
function parseExceptionReport(parsedXML) {
|
|
12
|
-
// const parsedXML = XMLLoader.parseTextSync?.(text, {
|
|
13
|
-
// ...options,
|
|
14
|
-
// xml: {
|
|
15
|
-
// ...options?.xml,
|
|
16
|
-
// removeNSPrefix: true,
|
|
17
|
-
// uncapitalizeKeys: true
|
|
18
|
-
// }
|
|
19
|
-
// });
|
|
20
|
-
const exceptionReport = parsedXML.exceptionReport;
|
|
21
|
-
if (!exceptionReport) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const errorMessage = exceptionReport.exception?.exceptionText ||
|
|
25
|
-
exceptionReport.exception?.exceptionCode ||
|
|
26
|
-
exceptionReport.exception?.locator ||
|
|
27
|
-
'server error';
|
|
28
|
-
throw new Error(`Catalog Server: ${errorMessage}`);
|
|
29
|
-
}
|
|
30
|
-
exports.parseExceptionReport = parseExceptionReport;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.deepStrictEqual = void 0;
|
|
5
|
-
// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
|
|
6
|
-
//
|
|
7
|
-
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
|
|
8
|
-
//
|
|
9
|
-
// Originally from narwhal.js (http://narwhaljs.org)
|
|
10
|
-
// Copyright (c) 2009 Thomas Robinson <280north.com>
|
|
11
|
-
//
|
|
12
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
// of this software and associated documentation files (the 'Software'), to
|
|
14
|
-
// deal in the Software without restriction, including without limitation the
|
|
15
|
-
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
16
|
-
// sell copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
// furnished to do so, subject to the following conditions:
|
|
18
|
-
//
|
|
19
|
-
// The above copyright notice and this permission notice shall be included in
|
|
20
|
-
// all copies or substantial portions of the Software.
|
|
21
|
-
//
|
|
22
|
-
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
26
|
-
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
27
|
-
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
/** @todo replace this ridiculous choice of deepStrictEqual */
|
|
29
|
-
// eslint-disable-next-line complexity
|
|
30
|
-
function deepStrictEqual(actual, expected, strict) {
|
|
31
|
-
// 7.1. All identical values are equivalent, as determined by ===.
|
|
32
|
-
if (actual === expected) {
|
|
33
|
-
return true;
|
|
34
|
-
// } else if (actual instanceof Buffer && expected instanceof Buffer) {
|
|
35
|
-
// return compare(actual, expected) === 0;
|
|
36
|
-
// // 7.2. If the expected value is a Date object, the actual value is
|
|
37
|
-
// // equivalent if it is also a Date object that refers to the same time.
|
|
38
|
-
}
|
|
39
|
-
else if (actual instanceof Date && expected instanceof Date) {
|
|
40
|
-
return actual.getTime() === expected.getTime();
|
|
41
|
-
// 7.3 If the expected value is a RegExp object, the actual value is
|
|
42
|
-
// equivalent if it is also a RegExp object with the same source and
|
|
43
|
-
// properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
|
|
44
|
-
}
|
|
45
|
-
else if (actual instanceof RegExp && expected instanceof RegExp) {
|
|
46
|
-
return (actual.source === expected.source &&
|
|
47
|
-
actual.global === expected.global &&
|
|
48
|
-
actual.multiline === expected.multiline &&
|
|
49
|
-
actual.lastIndex === expected.lastIndex &&
|
|
50
|
-
actual.ignoreCase === expected.ignoreCase);
|
|
51
|
-
// 7.4. Other pairs that do not both pass typeof value == 'object',
|
|
52
|
-
// equivalence is determined by ==.
|
|
53
|
-
}
|
|
54
|
-
else if ((actual === null || typeof actual !== 'object') &&
|
|
55
|
-
(expected === null || typeof expected !== 'object')) {
|
|
56
|
-
// eslint-disable-next-line eqeqeq
|
|
57
|
-
return strict ? actual === expected : actual == expected;
|
|
58
|
-
// 7.5 For all other Object pairs, including Array objects, equivalence is
|
|
59
|
-
// determined by having the same number of owned properties (as verified
|
|
60
|
-
// with Object.prototype.hasOwnProperty.call), the same set of keys
|
|
61
|
-
// (although not necessarily the same order), equivalent values for every
|
|
62
|
-
// corresponding key, and an identical 'prototype' property. Note: this
|
|
63
|
-
// accounts for both named and indexed properties on Arrays.
|
|
64
|
-
}
|
|
65
|
-
return objEquiv(actual, expected, strict);
|
|
66
|
-
}
|
|
67
|
-
exports.deepStrictEqual = deepStrictEqual;
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
69
|
-
const pSlice = Array.prototype.slice;
|
|
70
|
-
function isPrimitive(arg) {
|
|
71
|
-
return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');
|
|
72
|
-
}
|
|
73
|
-
function isArguments(object) {
|
|
74
|
-
// eslint-disable-next-line eqeqeq
|
|
75
|
-
return Object.prototype.toString.call(object) == '[object Arguments]';
|
|
76
|
-
}
|
|
77
|
-
// eslint-disable-next-line complexity
|
|
78
|
-
function objEquiv(a, b, strict) {
|
|
79
|
-
if (a === null || a === undefined || b === null || b === undefined)
|
|
80
|
-
return false;
|
|
81
|
-
// if one is a primitive, the other must be same
|
|
82
|
-
if (isPrimitive(a) || isPrimitive(b))
|
|
83
|
-
return a === b;
|
|
84
|
-
if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
|
|
85
|
-
return false;
|
|
86
|
-
const aIsArgs = isArguments(a);
|
|
87
|
-
const bIsArgs = isArguments(b);
|
|
88
|
-
if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
|
|
89
|
-
return false;
|
|
90
|
-
if (aIsArgs) {
|
|
91
|
-
a = pSlice.call(a);
|
|
92
|
-
b = pSlice.call(b);
|
|
93
|
-
return deepStrictEqual(a, b, strict);
|
|
94
|
-
}
|
|
95
|
-
const ka = Object.keys(a);
|
|
96
|
-
const kb = Object.keys(b);
|
|
97
|
-
let key;
|
|
98
|
-
let i;
|
|
99
|
-
// having the same number of owned properties (keys incorporates
|
|
100
|
-
// hasOwnProperty)
|
|
101
|
-
if (ka.length !== kb.length)
|
|
102
|
-
return false;
|
|
103
|
-
// the same set of keys (although not necessarily the same order),
|
|
104
|
-
ka.sort();
|
|
105
|
-
kb.sort();
|
|
106
|
-
// ~~~cheap key test
|
|
107
|
-
for (i = ka.length - 1; i >= 0; i--) {
|
|
108
|
-
if (ka[i] !== kb[i])
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
// equivalent values for every corresponding key, and
|
|
112
|
-
// ~~~possibly expensive deep test
|
|
113
|
-
for (i = ka.length - 1; i >= 0; i--) {
|
|
114
|
-
key = ka[i];
|
|
115
|
-
if (!deepStrictEqual(a[key], b[key], strict))
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
return true;
|
|
119
|
-
}
|