@loaders.gl/wms 4.2.0-alpha.6 → 4.2.0-beta.2
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/csw-capabilities-loader.d.ts +18 -2
- package/dist/csw-capabilities-loader.d.ts.map +1 -1
- package/dist/csw-capabilities-loader.js +3 -1
- package/dist/csw-domain-loader.d.ts +18 -2
- package/dist/csw-domain-loader.d.ts.map +1 -1
- package/dist/csw-domain-loader.js +3 -1
- package/dist/csw-records-loader.d.ts +18 -2
- package/dist/csw-records-loader.d.ts.map +1 -1
- package/dist/csw-records-loader.js +3 -1
- package/dist/gml-loader.d.ts +20 -2
- package/dist/gml-loader.d.ts.map +1 -1
- package/dist/gml-loader.js +3 -1
- package/dist/index.cjs +35 -7
- package/dist/index.cjs.map +2 -2
- package/dist/services/ogc/csw-service.d.ts +36 -1
- package/dist/services/ogc/csw-service.d.ts.map +1 -1
- package/dist/services/ogc/wms-service.d.ts.map +1 -1
- package/dist/services/ogc/wms-service.js +17 -0
- package/dist/wip/wcs-capabilities-loader.d.ts +14 -12
- package/dist/wip/wcs-capabilities-loader.d.ts.map +1 -1
- package/dist/wip/wcs-capabilities-loader.js +3 -1
- package/dist/wip/wfs-capabilities-loader.d.ts +18 -1
- package/dist/wip/wfs-capabilities-loader.d.ts.map +1 -1
- package/dist/wip/wfs-capabilities-loader.js +3 -1
- package/dist/wip/wms-feature-info-loader.d.ts +17 -3
- package/dist/wip/wms-feature-info-loader.d.ts.map +1 -1
- package/dist/wip/wms-feature-info-loader.js +4 -3
- package/dist/wip/wms-layer-description-loader.d.ts +15 -29
- package/dist/wip/wms-layer-description-loader.d.ts.map +1 -1
- package/dist/wip/wms-layer-description-loader.js +1 -1
- package/dist/wip/wmts-capabilities-loader.d.ts +15 -12
- package/dist/wip/wmts-capabilities-loader.d.ts.map +1 -1
- package/dist/wip/wmts-capabilities-loader.js +3 -1
- package/dist/wms-capabilities-loader.d.ts +18 -2
- package/dist/wms-capabilities-loader.d.ts.map +1 -1
- package/dist/wms-capabilities-loader.js +3 -1
- package/dist/wms-error-loader.d.ts +23 -2
- package/dist/wms-error-loader.d.ts.map +1 -1
- package/dist/wms-error-loader.js +3 -1
- package/package.json +6 -6
- package/src/csw-capabilities-loader.ts +5 -2
- package/src/csw-domain-loader.ts +5 -2
- package/src/csw-records-loader.ts +5 -2
- package/src/gml-loader.ts +5 -2
- package/src/services/ogc/wms-service.ts +21 -0
- package/src/wip/wcs-capabilities-loader.ts +4 -1
- package/src/wip/wfs-capabilities-loader.ts +5 -2
- package/src/wip/wms-feature-info-loader.ts +6 -6
- package/src/wip/wms-layer-description-loader.ts +2 -3
- package/src/wip/wmts-capabilities-loader.ts +5 -2
- package/src/wms-capabilities-loader.ts +5 -6
- package/src/wms-error-loader.ts +5 -2
|
@@ -20,7 +20,10 @@ export type CSWLoaderOptions = XMLLoaderOptions & {
|
|
|
20
20
|
/**
|
|
21
21
|
* Loader for the response to the CSW GetCapability request
|
|
22
22
|
*/
|
|
23
|
-
export const CSWRecordsLoader
|
|
23
|
+
export const CSWRecordsLoader = {
|
|
24
|
+
dataType: null as unknown as CSWRecords,
|
|
25
|
+
batchType: null as never,
|
|
26
|
+
|
|
24
27
|
id: 'csw-records',
|
|
25
28
|
name: 'CSW Records',
|
|
26
29
|
module: 'wms',
|
|
@@ -35,7 +38,7 @@ export const CSWRecordsLoader: LoaderWithParser<CSWRecords, never, CSWLoaderOpti
|
|
|
35
38
|
parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>
|
|
36
39
|
parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),
|
|
37
40
|
parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWRecords(text, options)
|
|
38
|
-
}
|
|
41
|
+
} as const satisfies LoaderWithParser<CSWRecords, never, CSWLoaderOptions>;
|
|
39
42
|
|
|
40
43
|
function testXMLFile(text: string): boolean {
|
|
41
44
|
// TODO - There could be space first.
|
package/src/gml-loader.ts
CHANGED
|
@@ -17,7 +17,10 @@ export type GMLLoaderOptions = LoaderOptions & {
|
|
|
17
17
|
/**
|
|
18
18
|
* Loader for the response to the GML GetCapability request
|
|
19
19
|
*/
|
|
20
|
-
export const GMLLoader
|
|
20
|
+
export const GMLLoader = {
|
|
21
|
+
dataType: null as unknown as Geometry | null,
|
|
22
|
+
batchType: null as never,
|
|
23
|
+
|
|
21
24
|
name: 'GML',
|
|
22
25
|
id: 'gml',
|
|
23
26
|
|
|
@@ -33,7 +36,7 @@ export const GMLLoader: LoaderWithParser<Geometry | null, never, GMLLoaderOption
|
|
|
33
36
|
parse: async (arrayBuffer: ArrayBuffer, options?: GMLLoaderOptions) =>
|
|
34
37
|
parseGML(new TextDecoder().decode(arrayBuffer), options),
|
|
35
38
|
parseTextSync: (text: string, options?: GMLLoaderOptions) => parseGML(text, options)
|
|
36
|
-
}
|
|
39
|
+
} as const satisfies LoaderWithParser<Geometry | null, never, GMLLoaderOptions>;
|
|
37
40
|
|
|
38
41
|
function testXMLFile(text: string): boolean {
|
|
39
42
|
// TODO - There could be space first.
|
|
@@ -376,6 +376,11 @@ export class WMSSource extends ImageSource<WMSSourceProps> {
|
|
|
376
376
|
vendorParameters?: Record<string, unknown>
|
|
377
377
|
): string {
|
|
378
378
|
wmsParameters = this._getWMS130Parameters(wmsParameters);
|
|
379
|
+
|
|
380
|
+
// Replace the GetImage `boundingBox` parameter with the WMS flat `bbox` parameter.
|
|
381
|
+
const {boundingBox, bbox} = wmsParameters as any;
|
|
382
|
+
wmsParameters.bbox = boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox!;
|
|
383
|
+
|
|
379
384
|
const options: Required<WMSGetFeatureInfoParameters> = {
|
|
380
385
|
version: this.wmsParameters.version,
|
|
381
386
|
// query_layers: [],
|
|
@@ -512,6 +517,22 @@ export class WMSSource extends ImageSource<WMSSourceProps> {
|
|
|
512
517
|
}
|
|
513
518
|
break;
|
|
514
519
|
|
|
520
|
+
case 'x':
|
|
521
|
+
// i is the parameter used in WMS 1.3
|
|
522
|
+
// TODO - change parameter to `i` and convert to `x` if not 1.3
|
|
523
|
+
if (wmsParameters.version === '1.3.0') {
|
|
524
|
+
key = 'i';
|
|
525
|
+
}
|
|
526
|
+
break;
|
|
527
|
+
|
|
528
|
+
case 'y':
|
|
529
|
+
// j is the parameter used in WMS 1.3
|
|
530
|
+
// TODO - change parameter to `j` and convert to `y` if not 1.3
|
|
531
|
+
if (wmsParameters.version === '1.3.0') {
|
|
532
|
+
key = 'j';
|
|
533
|
+
}
|
|
534
|
+
break;
|
|
535
|
+
|
|
515
536
|
default:
|
|
516
537
|
// do nothing
|
|
517
538
|
}
|
|
@@ -18,6 +18,9 @@ export type WCSLoaderOptions = LoaderOptions & {
|
|
|
18
18
|
* Loader for the response to the WCS GetCapability request
|
|
19
19
|
*/
|
|
20
20
|
export const WCSCapabilitiesLoader = {
|
|
21
|
+
dataType: null as unknown as WCSCapabilities,
|
|
22
|
+
batchType: null as never,
|
|
23
|
+
|
|
21
24
|
id: 'wcs-capabilities',
|
|
22
25
|
name: 'WFS Capabilities',
|
|
23
26
|
|
|
@@ -33,7 +36,7 @@ export const WCSCapabilitiesLoader = {
|
|
|
33
36
|
parse: async (arrayBuffer: ArrayBuffer, options?: WCSLoaderOptions) =>
|
|
34
37
|
parseWCSCapabilities(new TextDecoder().decode(arrayBuffer), options),
|
|
35
38
|
parseTextSync: (text: string, options?: WCSLoaderOptions) => parseWCSCapabilities(text, options)
|
|
36
|
-
}
|
|
39
|
+
} as const satisfies LoaderWithParser<WCSCapabilities, never, WCSLoaderOptions>;
|
|
37
40
|
|
|
38
41
|
function testXMLFile(text: string): boolean {
|
|
39
42
|
// TODO - There could be space first.
|
|
@@ -17,7 +17,10 @@ export type WFSLoaderOptions = LoaderOptions & {
|
|
|
17
17
|
/**
|
|
18
18
|
* Loader for the response to the WFS GetCapability request
|
|
19
19
|
*/
|
|
20
|
-
export const WFSCapabilitiesLoader
|
|
20
|
+
export const WFSCapabilitiesLoader = {
|
|
21
|
+
dataType: null as unknown as WFSCapabilities,
|
|
22
|
+
batchType: null as never,
|
|
23
|
+
|
|
21
24
|
id: 'wfs-capabilities',
|
|
22
25
|
name: 'WFS Capabilities',
|
|
23
26
|
|
|
@@ -33,7 +36,7 @@ export const WFSCapabilitiesLoader: LoaderWithParser<WFSCapabilities, never, WFS
|
|
|
33
36
|
parse: async (arrayBuffer: ArrayBuffer, options?: WFSLoaderOptions) =>
|
|
34
37
|
parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),
|
|
35
38
|
parseTextSync: (text: string, options?: WFSLoaderOptions) => parseWFSCapabilities(text, options)
|
|
36
|
-
}
|
|
39
|
+
} as const satisfies LoaderWithParser<WFSCapabilities, never, WFSLoaderOptions>;
|
|
37
40
|
|
|
38
41
|
function testXMLFile(text: string): boolean {
|
|
39
42
|
// TODO - There could be space first.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
// loaders.gl
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
2
4
|
|
|
3
5
|
import type {LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
4
6
|
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
@@ -12,9 +14,9 @@ export {WMSFeatureInfo};
|
|
|
12
14
|
/**
|
|
13
15
|
* Loader for the response to the WMS GetFeatureInfo request
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
export const WMSFeatureInfoLoader: LoaderWithParser<WMSFeatureInfo, never, XMLLoaderOptions> = {
|
|
17
|
+
export const WMSFeatureInfoLoader = {
|
|
17
18
|
...WMSCapabilitiesLoader,
|
|
19
|
+
dataType: null as unknown as WMSFeatureInfo,
|
|
18
20
|
|
|
19
21
|
id: 'wms-feature-info',
|
|
20
22
|
name: 'WMS FeatureInfo',
|
|
@@ -22,6 +24,4 @@ export const WMSFeatureInfoLoader: LoaderWithParser<WMSFeatureInfo, never, XMLLo
|
|
|
22
24
|
parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>
|
|
23
25
|
parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),
|
|
24
26
|
parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSFeatureInfo(text, options)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;
|
|
27
|
+
} as const satisfies LoaderWithParser<WMSFeatureInfo, never, XMLLoaderOptions>;
|
|
@@ -14,6 +14,7 @@ export {WMSLayerDescription};
|
|
|
14
14
|
*/
|
|
15
15
|
export const WMSLayerDescriptionLoader = {
|
|
16
16
|
...WMSCapabilitiesLoader,
|
|
17
|
+
dataType: null as unknown as WMSLayerDescription,
|
|
17
18
|
|
|
18
19
|
id: 'wms-layer-description',
|
|
19
20
|
name: 'WMS DescribeLayer',
|
|
@@ -21,6 +22,4 @@ export const WMSLayerDescriptionLoader = {
|
|
|
21
22
|
parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>
|
|
22
23
|
parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),
|
|
23
24
|
parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSLayerDescription(text, options)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSLayerDescriptionLoader;
|
|
25
|
+
} as const satisfies LoaderWithParser<WMSLayerDescription, never, XMLLoaderOptions>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type {LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
4
4
|
import type {XMLLoaderOptions} from '@loaders.gl/xml';
|
|
5
5
|
// import type {WMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';
|
|
6
|
-
import {parseWMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';
|
|
6
|
+
import {parseWMTSCapabilities, WMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';
|
|
7
7
|
|
|
8
8
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
9
9
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
@@ -19,6 +19,9 @@ export type WMTSLoaderOptions = XMLLoaderOptions & {
|
|
|
19
19
|
* Loader for the response to the WMTS GetCapability request
|
|
20
20
|
*/
|
|
21
21
|
export const WMTSCapabilitiesLoader = {
|
|
22
|
+
dataType: null as unknown as WMTSCapabilities,
|
|
23
|
+
batchType: null as never,
|
|
24
|
+
|
|
22
25
|
id: 'wmts-capabilities',
|
|
23
26
|
name: 'WMTS Capabilities',
|
|
24
27
|
|
|
@@ -34,7 +37,7 @@ export const WMTSCapabilitiesLoader = {
|
|
|
34
37
|
parse: async (arrayBuffer: ArrayBuffer, options?: WMTSLoaderOptions) =>
|
|
35
38
|
parseWMTSCapabilities(new TextDecoder().decode(arrayBuffer), options),
|
|
36
39
|
parseTextSync: (text: string, options?: WMTSLoaderOptions) => parseWMTSCapabilities(text, options)
|
|
37
|
-
}
|
|
40
|
+
} as const satisfies LoaderWithParser<WMTSCapabilities, never, WMTSLoaderOptions>;
|
|
38
41
|
|
|
39
42
|
function testXMLFile(text: string): boolean {
|
|
40
43
|
// TODO - There could be space first.
|
|
@@ -34,11 +34,10 @@ export type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {
|
|
|
34
34
|
/**
|
|
35
35
|
* Loader for the response to the WMS GetCapability request
|
|
36
36
|
*/
|
|
37
|
-
export const WMSCapabilitiesLoader
|
|
38
|
-
WMSCapabilities,
|
|
39
|
-
never,
|
|
40
|
-
|
|
41
|
-
> = {
|
|
37
|
+
export const WMSCapabilitiesLoader = {
|
|
38
|
+
dataType: null as unknown as WMSCapabilities,
|
|
39
|
+
batchType: null as never,
|
|
40
|
+
|
|
42
41
|
id: 'wms-capabilities',
|
|
43
42
|
name: 'WMS Capabilities',
|
|
44
43
|
|
|
@@ -57,7 +56,7 @@ export const WMSCapabilitiesLoader: LoaderWithParser<
|
|
|
57
56
|
parseTextSync: (text: string, options?: WMSCapabilitiesLoaderOptions) =>
|
|
58
57
|
// TODO pass in XML options
|
|
59
58
|
parseWMSCapabilities(text, options?.wms)
|
|
60
|
-
}
|
|
59
|
+
} as const satisfies LoaderWithParser<WMSCapabilities, never, WMSCapabilitiesLoaderOptions>;
|
|
61
60
|
|
|
62
61
|
function testXMLFile(text: string): boolean {
|
|
63
62
|
// TODO - There could be space first.
|
package/src/wms-error-loader.ts
CHANGED
|
@@ -21,7 +21,10 @@ export type WMSLoaderOptions = LoaderOptions & {
|
|
|
21
21
|
/**
|
|
22
22
|
* Loader for the response to the WMS GetCapability request
|
|
23
23
|
*/
|
|
24
|
-
export const WMSErrorLoader
|
|
24
|
+
export const WMSErrorLoader = {
|
|
25
|
+
dataType: null as unknown as string,
|
|
26
|
+
batchType: null as never,
|
|
27
|
+
|
|
25
28
|
id: 'wms-error',
|
|
26
29
|
name: 'WMS Error',
|
|
27
30
|
|
|
@@ -41,7 +44,7 @@ export const WMSErrorLoader: LoaderWithParser<string, never, WMSLoaderOptions> =
|
|
|
41
44
|
parseSync: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): string =>
|
|
42
45
|
parseTextSync(new TextDecoder().decode(arrayBuffer), options),
|
|
43
46
|
parseTextSync: (text: string, options?: WMSLoaderOptions): string => parseTextSync(text, options)
|
|
44
|
-
}
|
|
47
|
+
} as const satisfies LoaderWithParser<string, never, WMSLoaderOptions>;
|
|
45
48
|
|
|
46
49
|
function testXMLFile(text: string): boolean {
|
|
47
50
|
// TODO - There could be space first.
|