@loaders.gl/wms 3.4.0-alpha.3 → 3.4.0-alpha.4
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/dist.min.js +65 -14
- package/dist/es5/csw-capabilities-loader.js +1 -1
- package/dist/es5/csw-capabilities-loader.js.map +1 -1
- package/dist/es5/csw-domain-loader.js +1 -1
- package/dist/es5/csw-domain-loader.js.map +1 -1
- package/dist/es5/csw-records-loader.js +1 -1
- package/dist/es5/csw-records-loader.js.map +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/create-image-source.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-domain.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-records.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-exception-report.js.map +1 -1
- package/dist/es5/lib/parsers/gml/deep-strict-equal.js.map +1 -1
- package/dist/es5/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/es5/lib/parsers/xml/parse-xml-helpers.js.map +1 -1
- package/dist/es5/lib/services/arcgis/arcgis-image-service.js +1 -6
- package/dist/es5/lib/services/arcgis/arcgis-image-service.js.map +1 -1
- package/dist/es5/lib/services/arcgis/arcgis-server.js.map +1 -1
- package/dist/es5/lib/services/generic/image-service.js +1 -6
- package/dist/es5/lib/services/generic/image-service.js.map +1 -1
- package/dist/es5/lib/services/ogc/csw-service.js +0 -2
- package/dist/es5/lib/services/ogc/csw-service.js.map +1 -1
- package/dist/es5/lib/services/ogc/wms-service.js +62 -20
- package/dist/es5/lib/services/ogc/wms-service.js.map +1 -1
- package/dist/es5/lib/sources/data-source.js +36 -8
- package/dist/es5/lib/sources/data-source.js.map +1 -1
- package/dist/es5/lib/sources/image-source.js.map +1 -1
- package/dist/es5/lib/sources/tile-source.js.map +1 -1
- package/dist/es5/wip/arcgis-feature-service.js.map +1 -1
- package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
- package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
- package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -1
- package/dist/es5/wip/wms-feature-info-loader.js.map +1 -1
- package/dist/es5/wip/wms-layer-description-loader.js.map +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-capabilities-loader.js +1 -1
- package/dist/es5/wms-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-error-loader.js +1 -1
- package/dist/es5/wms-error-loader.js.map +1 -1
- package/dist/esm/csw-capabilities-loader.js +1 -1
- package/dist/esm/csw-capabilities-loader.js.map +1 -1
- package/dist/esm/csw-domain-loader.js +1 -1
- package/dist/esm/csw-domain-loader.js.map +1 -1
- package/dist/esm/csw-records-loader.js +1 -1
- package/dist/esm/csw-records-loader.js.map +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/create-image-source.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-exception-report.js.map +1 -1
- package/dist/esm/lib/parsers/gml/deep-strict-equal.js.map +1 -1
- package/dist/esm/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/esm/lib/parsers/xml/parse-xml-helpers.js.map +1 -1
- package/dist/esm/lib/services/arcgis/arcgis-image-service.js +0 -2
- package/dist/esm/lib/services/arcgis/arcgis-image-service.js.map +1 -1
- package/dist/esm/lib/services/arcgis/arcgis-server.js.map +1 -1
- package/dist/esm/lib/services/generic/image-service.js +0 -2
- package/dist/esm/lib/services/generic/image-service.js.map +1 -1
- package/dist/esm/lib/services/ogc/csw-service.js +0 -2
- package/dist/esm/lib/services/ogc/csw-service.js.map +1 -1
- package/dist/esm/lib/services/ogc/wms-service.js +54 -14
- package/dist/esm/lib/services/ogc/wms-service.js.map +1 -1
- package/dist/esm/lib/sources/data-source.js +20 -0
- package/dist/esm/lib/sources/data-source.js.map +1 -1
- package/dist/esm/lib/sources/image-source.js.map +1 -1
- package/dist/esm/lib/sources/tile-source.js.map +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -1
- package/dist/esm/wip/wms-feature-info-loader.js.map +1 -1
- package/dist/esm/wip/wms-layer-description-loader.js.map +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-capabilities-loader.js +1 -1
- package/dist/esm/wms-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-error-loader.js +1 -1
- package/dist/esm/wms-error-loader.js.map +1 -1
- package/dist/lib/create-image-source.d.ts +1 -1
- package/dist/lib/create-image-source.d.ts.map +1 -1
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +1 -0
- package/dist/lib/services/arcgis/arcgis-image-service.d.ts +1 -2
- package/dist/lib/services/arcgis/arcgis-image-service.d.ts.map +1 -1
- package/dist/lib/services/arcgis/arcgis-image-service.js +0 -1
- package/dist/lib/services/generic/image-service.d.ts +2 -3
- package/dist/lib/services/generic/image-service.d.ts.map +1 -1
- package/dist/lib/services/generic/image-service.js +0 -1
- package/dist/lib/services/ogc/csw-service.d.ts +1 -2
- package/dist/lib/services/ogc/csw-service.d.ts.map +1 -1
- package/dist/lib/services/ogc/csw-service.js +0 -1
- package/dist/lib/services/ogc/wms-service.d.ts +83 -32
- package/dist/lib/services/ogc/wms-service.d.ts.map +1 -1
- package/dist/lib/services/ogc/wms-service.js +73 -27
- package/dist/lib/sources/data-source.d.ts +12 -2
- package/dist/lib/sources/data-source.d.ts.map +1 -1
- package/dist/lib/sources/data-source.js +22 -0
- package/dist/lib/sources/image-source.d.ts +6 -6
- package/dist/lib/sources/image-source.d.ts.map +1 -1
- package/dist/lib/sources/tile-source.d.ts +4 -2
- package/dist/lib/sources/tile-source.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/lib/create-image-source.ts +1 -1
- package/src/lib/parsers/wms/parse-wms-capabilities.ts +1 -0
- package/src/lib/services/arcgis/arcgis-image-service.ts +1 -4
- package/src/lib/services/generic/image-service.ts +2 -5
- package/src/lib/services/ogc/csw-service.ts +1 -3
- package/src/lib/services/ogc/wms-service.ts +165 -60
- package/src/lib/sources/data-source.ts +29 -2
- package/src/lib/sources/image-source.ts +6 -6
- package/src/lib/sources/tile-source.ts +4 -2
- package/dist/es5/lib/services/generic/tile-service.js +0 -2
- package/dist/es5/lib/services/generic/tile-service.js.map +0 -1
- package/dist/esm/lib/services/generic/tile-service.js +0 -2
- package/dist/esm/lib/services/generic/tile-service.js.map +0 -1
- package/dist/lib/services/generic/tile-service.d.ts +0 -1
- package/dist/lib/services/generic/tile-service.d.ts.map +0 -1
- package/dist/lib/services/generic/tile-service.js +0 -1
- package/src/lib/services/generic/tile-service.ts +0 -0
|
@@ -6,63 +6,82 @@ import type { WMSCapabilities } from '../../../wms-capabilities-loader';
|
|
|
6
6
|
import type { WMSFeatureInfo } from '../../../wip/wms-feature-info-loader';
|
|
7
7
|
import type { WMSLayerDescription } from '../../../wip/wms-layer-description-loader';
|
|
8
8
|
import type { WMSLoaderOptions } from '../../../wms-error-loader';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* "Static" WMS parameters (not viewport or selected pixel dependent)
|
|
11
|
+
* These can be provided as defaults in the WMSService constructor
|
|
12
|
+
*/
|
|
10
13
|
export type WMSParameters = {
|
|
11
|
-
/** WMS version */
|
|
14
|
+
/** WMS version (all requests) */
|
|
12
15
|
version?: '1.3.0' | '1.1.1';
|
|
13
|
-
/** Layers to render */
|
|
16
|
+
/** Layers to render (GetMap, GetFeatureInfo) */
|
|
14
17
|
layers?: string[];
|
|
18
|
+
/** list of layers to query.. (GetFeatureInfo) */
|
|
19
|
+
query_layers?: string[];
|
|
15
20
|
/** Coordinate Reference System (CRS) for the image (not the bounding box) */
|
|
16
21
|
crs?: string;
|
|
17
|
-
/** Requested format for the return image */
|
|
22
|
+
/** Requested format for the return image (GetMap, GetLegendGraphic) */
|
|
18
23
|
format?: 'image/png';
|
|
19
|
-
/** Requested MIME type of returned feature info */
|
|
24
|
+
/** Requested MIME type of returned feature info (GetFeatureInfo) */
|
|
20
25
|
info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';
|
|
21
26
|
/** Styling - Not yet supported */
|
|
22
27
|
styles?: unknown;
|
|
23
|
-
/** Any additional parameters specific to this WMSService */
|
|
28
|
+
/** Any additional parameters specific to this WMSService (GetMap) */
|
|
24
29
|
transparent?: boolean;
|
|
25
30
|
};
|
|
26
|
-
|
|
31
|
+
/** Parameters for GetCapabilities */
|
|
32
|
+
export type WMSGetCapabilitiesParameters = {
|
|
27
33
|
/** In case the endpoint supports multiple WMS versions */
|
|
28
34
|
version?: '1.3.0' | '1.1.1';
|
|
29
35
|
};
|
|
30
|
-
/** Parameters for GetCapabilities */
|
|
31
|
-
export type WMSGetCapabilitiesParameters = WMSCommonParameters;
|
|
32
36
|
/** Parameters for GetMap */
|
|
33
|
-
export type WMSGetMapParameters =
|
|
34
|
-
/**
|
|
35
|
-
|
|
37
|
+
export type WMSGetMapParameters = {
|
|
38
|
+
/** In case the endpoint supports multiple WMS versions */
|
|
39
|
+
version?: '1.3.0' | '1.1.1';
|
|
36
40
|
/** bounding box of the requested map image */
|
|
37
41
|
bbox: [number, number, number, number];
|
|
38
42
|
/** pixel width of returned image */
|
|
39
43
|
width: number;
|
|
40
44
|
/** pixels */
|
|
41
45
|
height: number;
|
|
42
|
-
/**
|
|
46
|
+
/** Layers to render - can be provided in service constructor */
|
|
47
|
+
layers?: string | string[];
|
|
48
|
+
/** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */
|
|
43
49
|
crs?: string;
|
|
44
|
-
/** Styling */
|
|
50
|
+
/** Styling. can be provided in service constructor */
|
|
45
51
|
styles?: unknown;
|
|
46
|
-
/** Don't render background when no data */
|
|
52
|
+
/** Don't render background when no data. can be provided in service constructor */
|
|
47
53
|
transparent?: boolean;
|
|
48
|
-
/** requested format for the return image */
|
|
54
|
+
/** requested format for the return image. can be provided in service constructor */
|
|
49
55
|
format?: 'image/png';
|
|
50
56
|
};
|
|
57
|
+
/** GetMap parameters that are specific to the current view */
|
|
58
|
+
export type WMSGetMapViewParameters = {
|
|
59
|
+
/** pixel width of returned image */
|
|
60
|
+
width: number;
|
|
61
|
+
/** pixels */
|
|
62
|
+
height: number;
|
|
63
|
+
/** bounding box of the requested map image */
|
|
64
|
+
bbox: [number, number, number, number];
|
|
65
|
+
/** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */
|
|
66
|
+
crs?: string;
|
|
67
|
+
};
|
|
51
68
|
/**
|
|
52
69
|
* Parameters for GetFeatureInfo
|
|
53
70
|
* @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&
|
|
54
71
|
*/
|
|
55
|
-
export type WMSGetFeatureInfoParameters =
|
|
72
|
+
export type WMSGetFeatureInfoParameters = {
|
|
73
|
+
/** In case the endpoint supports multiple WMS versions */
|
|
74
|
+
version?: '1.3.0' | '1.1.1';
|
|
56
75
|
/** x coordinate for the feature info request */
|
|
57
76
|
x: number;
|
|
58
77
|
/** y coordinate for the feature info request */
|
|
59
78
|
y: number;
|
|
60
|
-
/**
|
|
61
|
-
query_layers: string[];
|
|
62
|
-
/** Requested MIME type of returned feature info */
|
|
79
|
+
/** MIME type of returned feature info. Can be specified in service constructor */
|
|
63
80
|
info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';
|
|
64
|
-
/**
|
|
65
|
-
|
|
81
|
+
/** list of layers to query. Required but can be specified in service constructor. */
|
|
82
|
+
query_layers?: string[];
|
|
83
|
+
/** Layers to render. Required, but can be specified in service constructor */
|
|
84
|
+
layers?: string[];
|
|
66
85
|
/** Styling */
|
|
67
86
|
styles?: unknown;
|
|
68
87
|
/** bounding box of the requested map image */
|
|
@@ -72,18 +91,39 @@ export type WMSGetFeatureInfoParameters = WMSCommonParameters & {
|
|
|
72
91
|
/** pixels */
|
|
73
92
|
height: number;
|
|
74
93
|
/** srs for the image (not the bounding box) */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
crs?: string;
|
|
95
|
+
};
|
|
96
|
+
/** GetMap parameters that are specific to the current view */
|
|
97
|
+
export type WMSGetFeatureInfoViewParameters = {
|
|
98
|
+
/** x coordinate for the feature info request */
|
|
99
|
+
x: number;
|
|
100
|
+
/** y coordinate for the feature info request */
|
|
101
|
+
y: number;
|
|
102
|
+
/** pixel width of returned image */
|
|
103
|
+
width: number;
|
|
104
|
+
/** pixels */
|
|
105
|
+
height: number;
|
|
106
|
+
/** bounding box of the requested map image */
|
|
107
|
+
bbox: [number, number, number, number];
|
|
108
|
+
/** srs for the image (not the bounding box) */
|
|
109
|
+
crs?: string;
|
|
78
110
|
};
|
|
79
111
|
/** Parameters for DescribeLayer */
|
|
80
|
-
export type WMSDescribeLayerParameters =
|
|
112
|
+
export type WMSDescribeLayerParameters = {
|
|
113
|
+
/** In case the endpoint supports multiple WMS versions */
|
|
114
|
+
version?: '1.3.0' | '1.1.1';
|
|
115
|
+
};
|
|
81
116
|
/** Parameters for GetLegendGraphic */
|
|
82
|
-
export type WMSGetLegendGraphicParameters =
|
|
117
|
+
export type WMSGetLegendGraphicParameters = {
|
|
118
|
+
/** In case the endpoint supports multiple WMS versions */
|
|
119
|
+
version?: '1.3.0' | '1.1.1';
|
|
120
|
+
};
|
|
83
121
|
/** Properties for creating a enw WMS service */
|
|
84
122
|
export type WMSServiceProps = ImageSourceProps & {
|
|
85
123
|
/** Base URL to the service */
|
|
86
124
|
url: string;
|
|
125
|
+
/** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */
|
|
126
|
+
substituteCRS84?: boolean;
|
|
87
127
|
/** Default WMS parameters. If not provided here, must be provided in the various request */
|
|
88
128
|
wmsParameters?: WMSParameters;
|
|
89
129
|
/** Any additional service specific parameters */
|
|
@@ -96,10 +136,15 @@ export type WMSServiceProps = ImageSourceProps & {
|
|
|
96
136
|
* - implements the ImageService interface
|
|
97
137
|
* @note Only the URL parameter conversion is supported. XML posts are not supported.
|
|
98
138
|
*/
|
|
99
|
-
export declare class WMSService extends ImageSource {
|
|
139
|
+
export declare class WMSService extends ImageSource<WMSServiceProps> {
|
|
100
140
|
static type: 'wms';
|
|
101
141
|
static testURL: (url: string) => boolean;
|
|
142
|
+
/** Base URL to the service */
|
|
102
143
|
readonly url: string;
|
|
144
|
+
/** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */
|
|
145
|
+
substituteCRS84: boolean;
|
|
146
|
+
/** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */
|
|
147
|
+
flipCRS: string[];
|
|
103
148
|
/** Default static WMS parameters */
|
|
104
149
|
wmsParameters: Required<WMSParameters>;
|
|
105
150
|
/** Default static vendor parameters */
|
|
@@ -121,7 +166,6 @@ export declare class WMSService extends ImageSource {
|
|
|
121
166
|
};
|
|
122
167
|
};
|
|
123
168
|
parse: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions | undefined) => Promise<string>;
|
|
124
|
-
/** WMS version */
|
|
125
169
|
parseSync: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions | undefined) => string;
|
|
126
170
|
parseTextSync: (text: string, options?: WMSLoaderOptions | undefined) => string;
|
|
127
171
|
} | {
|
|
@@ -198,15 +242,22 @@ export declare class WMSService extends ImageSource {
|
|
|
198
242
|
* @note case _getWMSUrl may need to be overridden to handle certain backends?
|
|
199
243
|
* @note at the moment, only URLs with parameters are supported (no XML payloads)
|
|
200
244
|
* */
|
|
201
|
-
protected _getWMSUrl(request: string, wmsParameters:
|
|
245
|
+
protected _getWMSUrl(request: string, wmsParameters: {
|
|
246
|
+
version?: '1.3.0' | '1.1.1';
|
|
202
247
|
[key: string]: unknown;
|
|
203
248
|
}, vendorParameters?: Record<string, unknown>): string;
|
|
204
|
-
|
|
249
|
+
_getWMS130Parameters<ParametersT extends {
|
|
250
|
+
crs?: string;
|
|
251
|
+
srs?: string;
|
|
252
|
+
}>(wmsParameters: ParametersT): ParametersT;
|
|
253
|
+
_getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string;
|
|
254
|
+
/** Coordinate order is flipped for certain CRS in WMS 1.3.0 */
|
|
255
|
+
_flipBoundingBox(bboxValue: unknown, wmsParameters: WMSParameters): [number, number, number, number] | null;
|
|
256
|
+
/** Fetches an array buffer and checks the response (boilerplate reduction) */
|
|
205
257
|
protected _fetchArrayBuffer(url: string): Promise<ArrayBuffer>;
|
|
206
258
|
/** Checks for and parses a WMS XML formatted ServiceError and throws an exception */
|
|
207
259
|
protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void;
|
|
208
260
|
/** Error situation detected */
|
|
209
261
|
protected _parseError(arrayBuffer: ArrayBuffer): Error;
|
|
210
262
|
}
|
|
211
|
-
export {};
|
|
212
263
|
//# sourceMappingURL=wms-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/ogc/wms-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wms-service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/ogc/wms-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAIlD,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AACxF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAMnF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAGhE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,6EAA6E;IAC7E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,YAAY,GAAG,qBAAqB,GAAG,yBAAyB,CAAC;IAC/E,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,qCAAqC;AACrC,MAAM,MAAM,4BAA4B,GAAG;IACzC,0DAA0D;IAC1D,OAAO,CAAC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AAM,GAAG;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC;IAa7E;;;;SAIK;IACL,SAAS,CAAC,UAAU,CAClB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,EACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,MAAM;IA2BT,oBAAoB,CAAC,WAAW,SAAS;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,EACnE,aAAa,EAAE,WAAW,GACzB,WAAW;IAUd,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM;IAwCnF,+DAA+D;IAC/D,gBAAgB,CACd,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAkB1C,8EAA8E;cAC9D,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOpE,qFAAqF;IACrF,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI;IAY5E,+BAA+B;IAC/B,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK;CAIvD"}
|
|
@@ -33,8 +33,11 @@ class WMSService extends image_source_1.ImageSource {
|
|
|
33
33
|
// This would make pasting in any WMS URL more likely to make this class just work.
|
|
34
34
|
// const {baseUrl, parameters} = this._parseWMSUrl(props.url);
|
|
35
35
|
this.url = props.url;
|
|
36
|
+
this.substituteCRS84 = props.substituteCRS84 ?? false;
|
|
37
|
+
this.flipCRS = ['EPSG:4326'];
|
|
36
38
|
this.wmsParameters = {
|
|
37
39
|
layers: undefined,
|
|
40
|
+
query_layers: undefined,
|
|
38
41
|
styles: undefined,
|
|
39
42
|
version: '1.3.0',
|
|
40
43
|
crs: 'EPSG:4326',
|
|
@@ -51,10 +54,7 @@ class WMSService extends image_source_1.ImageSource {
|
|
|
51
54
|
return this.normalizeMetadata(capabilities);
|
|
52
55
|
}
|
|
53
56
|
async getImage(parameters) {
|
|
54
|
-
|
|
55
|
-
const wmsParameters = { ...parameters, crs: parameters.srs };
|
|
56
|
-
delete wmsParameters.srs;
|
|
57
|
-
return await this.getMap(wmsParameters);
|
|
57
|
+
return await this.getMap(parameters);
|
|
58
58
|
}
|
|
59
59
|
normalizeMetadata(capabilities) {
|
|
60
60
|
return capabilities;
|
|
@@ -132,16 +132,17 @@ class WMSService extends image_source_1.ImageSource {
|
|
|
132
132
|
}
|
|
133
133
|
/** Generate a URL for the GetMap request */
|
|
134
134
|
getMapURL(wmsParameters, vendorParameters) {
|
|
135
|
+
wmsParameters = this._getWMS130Parameters(wmsParameters);
|
|
135
136
|
const options = {
|
|
136
137
|
version: this.wmsParameters.version,
|
|
137
|
-
|
|
138
|
+
format: this.wmsParameters.format,
|
|
139
|
+
transparent: this.wmsParameters.transparent,
|
|
140
|
+
layers: this.wmsParameters.layers,
|
|
141
|
+
styles: this.wmsParameters.styles,
|
|
142
|
+
crs: this.wmsParameters.crs,
|
|
138
143
|
// bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
|
|
139
144
|
// width: 1200,
|
|
140
145
|
// height: 900,
|
|
141
|
-
styles: this.wmsParameters.styles,
|
|
142
|
-
crs: this.wmsParameters.crs,
|
|
143
|
-
format: this.wmsParameters.format,
|
|
144
|
-
transparent: this.wmsParameters.transparent,
|
|
145
146
|
...wmsParameters
|
|
146
147
|
};
|
|
147
148
|
return this._getWMSUrl('GetMap', options, vendorParameters);
|
|
@@ -150,17 +151,18 @@ class WMSService extends image_source_1.ImageSource {
|
|
|
150
151
|
getFeatureInfoURL(wmsParameters, vendorParameters) {
|
|
151
152
|
const options = {
|
|
152
153
|
version: this.wmsParameters.version,
|
|
153
|
-
//
|
|
154
|
+
// query_layers: [],
|
|
155
|
+
// format: this.wmsParameters.format,
|
|
156
|
+
info_format: this.wmsParameters.info_format,
|
|
157
|
+
layers: this.wmsParameters.layers,
|
|
158
|
+
query_layers: this.wmsParameters.query_layers,
|
|
159
|
+
styles: this.wmsParameters.styles,
|
|
160
|
+
crs: this.wmsParameters.crs,
|
|
154
161
|
// bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
|
|
155
162
|
// width: 1200,
|
|
156
163
|
// height: 900,
|
|
157
164
|
// x: undefined!,
|
|
158
165
|
// y: undefined!,
|
|
159
|
-
// query_layers: [],
|
|
160
|
-
srs: this.wmsParameters.crs,
|
|
161
|
-
format: this.wmsParameters.format,
|
|
162
|
-
info_format: this.wmsParameters.info_format,
|
|
163
|
-
styles: this.wmsParameters.styles,
|
|
164
166
|
...wmsParameters
|
|
165
167
|
};
|
|
166
168
|
return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);
|
|
@@ -215,28 +217,72 @@ class WMSService extends image_source_1.ImageSource {
|
|
|
215
217
|
if (key !== 'transparent' || value) {
|
|
216
218
|
url += first ? '?' : '&';
|
|
217
219
|
first = false;
|
|
218
|
-
url += this.
|
|
220
|
+
url += this._getURLParameter(key, value, wmsParameters);
|
|
219
221
|
}
|
|
220
222
|
}
|
|
221
223
|
return encodeURI(url);
|
|
222
224
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (
|
|
226
|
-
|
|
225
|
+
_getWMS130Parameters(wmsParameters) {
|
|
226
|
+
const newParameters = { ...wmsParameters };
|
|
227
|
+
if (newParameters.srs) {
|
|
228
|
+
newParameters.crs = newParameters.crs || newParameters.srs;
|
|
229
|
+
delete newParameters.srs;
|
|
230
|
+
}
|
|
231
|
+
return newParameters;
|
|
232
|
+
}
|
|
233
|
+
// eslint-disable-complexity
|
|
234
|
+
_getURLParameter(key, value, wmsParameters) {
|
|
235
|
+
// Substitute by key
|
|
236
|
+
switch (key) {
|
|
237
|
+
case 'crs':
|
|
238
|
+
// CRS was called SRS before WMS 1.3.0
|
|
239
|
+
if (wmsParameters.version !== '1.3.0') {
|
|
240
|
+
key = 'srs';
|
|
241
|
+
}
|
|
242
|
+
else if (this.substituteCRS84 && value === 'EPSG:4326') {
|
|
243
|
+
/** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */
|
|
244
|
+
// Substitute by value
|
|
245
|
+
value = 'CRS:84';
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
case 'srs':
|
|
249
|
+
// CRS was called SRS before WMS 1.3.0
|
|
250
|
+
if (wmsParameters.version === '1.3.0') {
|
|
251
|
+
key = 'crs';
|
|
252
|
+
}
|
|
253
|
+
break;
|
|
254
|
+
case 'bbox':
|
|
255
|
+
// Coordinate order is flipped for certain CRS in WMS 1.3.0
|
|
256
|
+
const bbox = this._flipBoundingBox(value, wmsParameters);
|
|
257
|
+
if (bbox) {
|
|
258
|
+
value = bbox;
|
|
259
|
+
}
|
|
260
|
+
break;
|
|
261
|
+
default:
|
|
262
|
+
// do nothing
|
|
227
263
|
}
|
|
228
264
|
key = key.toUpperCase();
|
|
229
|
-
// TODO - in v1.3.0 only, the order of parameters for BBOX depends on whether the CRS definition has flipped axes
|
|
230
|
-
// You will see this in the GetCapabilities request at 1.3.0 - the response should show the flipped axes.
|
|
231
|
-
// BBOX=xmin,ymin,xmax,ymax NON-FLIPPED
|
|
232
|
-
// BBOX=ymin,xmin,ymax,xmax FLIPPED
|
|
233
|
-
// / EPSG:4326 needs to have flipped axes. 4326 1 WGS 84 Latitude North Longitude East
|
|
234
|
-
// In WMS 1.1.1 EPSG:4326 is wrongly defined as having long/lat coordinate axes. In WMS 1.3.0 the correct axes lat/long are used. CRS:84 is defined by OGC as having the same datum as EPSG:4326 (that is the World Geodetic System 1984 datum ~ EPSG::6326) but axis order of long/lat.
|
|
235
|
-
// CRS:84 was introduced with the publication of the WMS 1.3.0 specification, to overcome this issue.
|
|
236
265
|
return Array.isArray(value)
|
|
237
266
|
? `${key}=${value.join(',')}`
|
|
238
267
|
: `${key}=${value ? String(value) : ''}`;
|
|
239
268
|
}
|
|
269
|
+
/** Coordinate order is flipped for certain CRS in WMS 1.3.0 */
|
|
270
|
+
_flipBoundingBox(bboxValue, wmsParameters) {
|
|
271
|
+
// Sanity checks
|
|
272
|
+
if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
const flipCoordinates =
|
|
276
|
+
// Only affects WMS 1.3.0
|
|
277
|
+
wmsParameters.version === '1.3.0' &&
|
|
278
|
+
// Flip if we are dealing with a CRS that was flipped in 1.3.0
|
|
279
|
+
this.flipCRS.includes(wmsParameters.crs || '') &&
|
|
280
|
+
// Don't flip if we are subsituting EPSG:4326 with CRS:84
|
|
281
|
+
!(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');
|
|
282
|
+
const bbox = bboxValue;
|
|
283
|
+
return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;
|
|
284
|
+
}
|
|
285
|
+
/** Fetches an array buffer and checks the response (boilerplate reduction) */
|
|
240
286
|
async _fetchArrayBuffer(url) {
|
|
241
287
|
const response = await this.fetch(url);
|
|
242
288
|
const arrayBuffer = await response.arrayBuffer();
|
|
@@ -4,12 +4,22 @@ export type DataSourceProps = {
|
|
|
4
4
|
loadOptions?: LoaderOptions;
|
|
5
5
|
};
|
|
6
6
|
/** base class of all data sources */
|
|
7
|
-
export declare abstract class DataSource {
|
|
7
|
+
export declare abstract class DataSource<PropsT extends DataSourceProps> {
|
|
8
8
|
/** A resolved fetch function extracted from loadOptions prop */
|
|
9
9
|
fetch: (url: string, options?: RequestInit) => Promise<Response>;
|
|
10
10
|
/** The actual load options, if calling a loaders.gl loader */
|
|
11
11
|
loadOptions: LoaderOptions;
|
|
12
|
-
|
|
12
|
+
_needsRefresh: boolean;
|
|
13
|
+
props: PropsT;
|
|
14
|
+
constructor(props: PropsT);
|
|
15
|
+
setProps(props: PropsT): void;
|
|
16
|
+
/** Mark this data source as needing a refresh (redraw) */
|
|
17
|
+
setNeedsRefresh(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Does this data source need refreshing?
|
|
20
|
+
* @note The specifics of the refresh mechanism depends on type of data source
|
|
21
|
+
*/
|
|
22
|
+
getNeedsRefresh(clear?: boolean): boolean;
|
|
13
23
|
}
|
|
14
24
|
/**
|
|
15
25
|
* Gets the current fetch function from options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/data-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,qCAAqC;AACrC,8BAAsB,UAAU;
|
|
1
|
+
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/data-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,qCAAqC;AACrC,8BAAsB,UAAU,CAAC,MAAM,SAAS,eAAe;IAC7D,gEAAgE;IAChE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE,8DAA8D;IAC9D,WAAW,EAAE,aAAa,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAQ;IAE9B,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,MAAM;IAMzB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,0DAA0D;IAC1D,eAAe,IAAI,IAAI;IAIvB;;;OAGG;IACH,eAAe,CAAC,KAAK,GAAE,OAAc;CAOtC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,SAKvC,MAAM,iBAAiB,WAAW,uBAWlD"}
|
|
@@ -5,9 +5,31 @@ exports.getFetchFunction = exports.DataSource = void 0;
|
|
|
5
5
|
/** base class of all data sources */
|
|
6
6
|
class DataSource {
|
|
7
7
|
constructor(props) {
|
|
8
|
+
this._needsRefresh = true;
|
|
9
|
+
this.props = { ...props };
|
|
8
10
|
this.loadOptions = { ...props.loadOptions };
|
|
9
11
|
this.fetch = getFetchFunction(this.loadOptions);
|
|
10
12
|
}
|
|
13
|
+
setProps(props) {
|
|
14
|
+
this.props = Object.assign(this.props, props);
|
|
15
|
+
// TODO - add a shallow compare to avoid setting refresh if no change?
|
|
16
|
+
this.setNeedsRefresh();
|
|
17
|
+
}
|
|
18
|
+
/** Mark this data source as needing a refresh (redraw) */
|
|
19
|
+
setNeedsRefresh() {
|
|
20
|
+
this._needsRefresh = true;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Does this data source need refreshing?
|
|
24
|
+
* @note The specifics of the refresh mechanism depends on type of data source
|
|
25
|
+
*/
|
|
26
|
+
getNeedsRefresh(clear = true) {
|
|
27
|
+
const needsRefresh = this._needsRefresh;
|
|
28
|
+
if (clear) {
|
|
29
|
+
this._needsRefresh = false;
|
|
30
|
+
}
|
|
31
|
+
return needsRefresh;
|
|
32
|
+
}
|
|
11
33
|
}
|
|
12
34
|
exports.DataSource = DataSource;
|
|
13
35
|
/**
|
|
@@ -17,7 +17,7 @@ export type ImageSourceMetadata = {
|
|
|
17
17
|
export type ImageSourceLayer = {
|
|
18
18
|
name?: string;
|
|
19
19
|
title?: string;
|
|
20
|
-
|
|
20
|
+
crs?: string[];
|
|
21
21
|
boundingBox?: [number, number, number, number];
|
|
22
22
|
layers?: ImageSourceLayer[];
|
|
23
23
|
};
|
|
@@ -32,8 +32,8 @@ export type GetImageParameters = {
|
|
|
32
32
|
width: number;
|
|
33
33
|
/** pixels */
|
|
34
34
|
height: number;
|
|
35
|
-
/**
|
|
36
|
-
|
|
35
|
+
/** crs for the image (not the bounding box) */
|
|
36
|
+
crs?: string;
|
|
37
37
|
/** requested format for the return image */
|
|
38
38
|
format?: 'image/png';
|
|
39
39
|
};
|
|
@@ -52,8 +52,8 @@ export type ImageFormat = {
|
|
|
52
52
|
width: number;
|
|
53
53
|
/** pixels */
|
|
54
54
|
height: number;
|
|
55
|
-
/**
|
|
56
|
-
|
|
55
|
+
/** crs for the image (not the bounding box) */
|
|
56
|
+
crs?: string;
|
|
57
57
|
/** requested format for the return image */
|
|
58
58
|
format?: 'image/png';
|
|
59
59
|
};
|
|
@@ -63,7 +63,7 @@ export type ImageSourceProps = DataSourceProps;
|
|
|
63
63
|
* @note
|
|
64
64
|
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
65
65
|
*/
|
|
66
|
-
export declare abstract class ImageSource extends DataSource {
|
|
66
|
+
export declare abstract class ImageSource<PropsT extends ImageSourceProps> extends DataSource<PropsT> {
|
|
67
67
|
abstract getMetadata(): Promise<ImageSourceMetadata>;
|
|
68
68
|
abstract getImage(parameters: GetImageParameters): Promise<ImageType>;
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,MAAM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,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa;IACb,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG;IACzB,uBAAuB;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,cAAc;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,8CAA8C;IAC9C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa;IACb,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAE/C;;;;GAIG;AACH,8BAAsB,WAAW,CAAC,MAAM,SAAS,gBAAgB,CAAE,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC3F,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IACpD,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;CACtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ImageType } from '@loaders.gl/images';
|
|
2
|
-
import { DataSource } from './data-source';
|
|
2
|
+
import { DataSource, DataSourceProps } from './data-source';
|
|
3
3
|
/**
|
|
4
4
|
* Normalized capabilities of an Image service
|
|
5
5
|
* @example
|
|
@@ -42,13 +42,15 @@ export type GetTileParameters = {
|
|
|
42
42
|
/** requested format for the return image */
|
|
43
43
|
format?: 'image/png';
|
|
44
44
|
};
|
|
45
|
+
type TileSourceProps = DataSourceProps;
|
|
45
46
|
/**
|
|
46
47
|
* MapTileSource - data sources that allow data to be queried by (geospatial) extents
|
|
47
48
|
* @note
|
|
48
49
|
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
49
50
|
*/
|
|
50
|
-
export declare abstract class TileSource extends DataSource {
|
|
51
|
+
export declare abstract class TileSource<PropsT extends TileSourceProps> extends DataSource<PropsT> {
|
|
51
52
|
abstract getMetadata(): Promise<TileSourceMetadata>;
|
|
52
53
|
abstract getTile(parameters: GetTileParameters): Promise<ImageType>;
|
|
53
54
|
}
|
|
55
|
+
export {};
|
|
54
56
|
//# sourceMappingURL=tile-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/tile-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/tile-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,C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|
"name": "@loaders.gl/wms",
|
|
3
|
-
"version": "3.4.0-alpha.
|
|
3
|
+
"version": "3.4.0-alpha.4",
|
|
4
4
|
"description": "Framework-independent loaders for the WMS (Web Map Service) standard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/runtime": "^7.3.1",
|
|
42
|
-
"@loaders.gl/images": "3.4.0-alpha.
|
|
43
|
-
"@loaders.gl/loader-utils": "3.4.0-alpha.
|
|
44
|
-
"@loaders.gl/schema": "3.4.0-alpha.
|
|
45
|
-
"@loaders.gl/xml": "3.4.0-alpha.
|
|
42
|
+
"@loaders.gl/images": "3.4.0-alpha.4",
|
|
43
|
+
"@loaders.gl/loader-utils": "3.4.0-alpha.4",
|
|
44
|
+
"@loaders.gl/schema": "3.4.0-alpha.4",
|
|
45
|
+
"@loaders.gl/xml": "3.4.0-alpha.4",
|
|
46
46
|
"@turf/rewind": "^5.1.5",
|
|
47
47
|
"deep-strict-equal": "^0.2.0",
|
|
48
48
|
"lerc": "^4.0.1"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"xmldom": "0.6.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f039a523df8b908a91f26c5ba8c4cfc1924b6140"
|
|
54
54
|
}
|
|
@@ -22,7 +22,7 @@ type ImageSourceProps = ImageServiceProps &
|
|
|
22
22
|
* @param type type of source. if not known, set to 'auto'
|
|
23
23
|
* @returns an ImageSource instance
|
|
24
24
|
*/
|
|
25
|
-
export function createImageSource(props: ImageSourceProps): ImageSource {
|
|
25
|
+
export function createImageSource(props: ImageSourceProps): ImageSource<ImageSourceProps> {
|
|
26
26
|
const {type = 'auto'} = props;
|
|
27
27
|
const serviceType = type === 'auto' ? guessServiceType(props.url) : type;
|
|
28
28
|
switch (serviceType) {
|
|
@@ -340,6 +340,7 @@ function extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
/** Traverse layers and inject missing props from parents */
|
|
343
|
+
// eslint-disable-next-line complexity
|
|
343
344
|
function addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {
|
|
344
345
|
if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {
|
|
345
346
|
layer.geographicBoundingBox = [...parent.geographicBoundingBox];
|
|
@@ -14,15 +14,12 @@ export type ArcGISImageServerProps = ImageSourceProps & {
|
|
|
14
14
|
* Note - exports a big API, that could be exposed here if there is a use case
|
|
15
15
|
* @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm
|
|
16
16
|
*/
|
|
17
|
-
export class ArcGISImageServer extends ImageSource {
|
|
17
|
+
export class ArcGISImageServer extends ImageSource<ArcGISImageServerProps> {
|
|
18
18
|
static type: 'arcgis-image-server' = 'arcgis-image-server';
|
|
19
19
|
static testURL = (url: string): boolean => url.toLowerCase().includes('ImageServer');
|
|
20
20
|
|
|
21
|
-
props: ArcGISImageServerProps;
|
|
22
|
-
|
|
23
21
|
constructor(props: ArcGISImageServerProps) {
|
|
24
22
|
super(props);
|
|
25
|
-
this.props = props;
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
// ImageSource (normalized endpoints)
|
|
@@ -20,15 +20,12 @@ export type ImageServiceProps = {
|
|
|
20
20
|
* ImageSource allows template url strings to be used to ad hoc connect to arbitrary image data sources
|
|
21
21
|
* Accepts a template url string and builds requests URLs
|
|
22
22
|
*/
|
|
23
|
-
export class ImageService extends ImageSource {
|
|
23
|
+
export class ImageService<PropsT extends ImageServiceProps> extends ImageSource<PropsT> {
|
|
24
24
|
static type: 'template' = 'template';
|
|
25
25
|
static testURL = (url: string): boolean => url.toLowerCase().includes('{');
|
|
26
26
|
|
|
27
|
-
props:
|
|
28
|
-
|
|
29
|
-
constructor(props: ImageServiceProps) {
|
|
27
|
+
constructor(props: PropsT) {
|
|
30
28
|
super(props);
|
|
31
|
-
this.props = props;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
// IMAGE SOURCE API
|
|
@@ -54,11 +54,10 @@ export type CSWServiceProps = DataSourceProps & {
|
|
|
54
54
|
* - implements the ImageService interface
|
|
55
55
|
* @note Only the URL parameter conversion is supported. XML posts are not supported.
|
|
56
56
|
*/
|
|
57
|
-
export class CSWService extends DataSource {
|
|
57
|
+
export class CSWService extends DataSource<CSWServiceProps> {
|
|
58
58
|
static type: 'csw' = 'csw';
|
|
59
59
|
static testURL = (url: string): boolean => url.toLowerCase().includes('csw');
|
|
60
60
|
|
|
61
|
-
props: CSWServiceProps;
|
|
62
61
|
capabilities: CSWCapabilities | null = null;
|
|
63
62
|
|
|
64
63
|
/** A list of loaders used by the CSWService methods */
|
|
@@ -67,7 +66,6 @@ export class CSWService extends DataSource {
|
|
|
67
66
|
/** Create a CSWService */
|
|
68
67
|
constructor(props: CSWServiceProps) {
|
|
69
68
|
super(props);
|
|
70
|
-
this.props = props;
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
async getMetadata(): Promise<CSWCapabilities> {
|