@loaders.gl/wms 3.4.0-alpha.3 → 4.0.0-alpha.6
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 +133 -80
- 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 +2 -1
- package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-domain.js +2 -1
- package/dist/es5/lib/parsers/csw/parse-csw-domain.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-records.js +6 -5
- 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 +2 -1
- package/dist/es5/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +2 -1
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-features.js +2 -2
- package/dist/es5/lib/parsers/wms/parse-wms-features.js.map +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js +2 -1
- package/dist/es5/lib/parsers/wms/parse-wms-layer-description.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/lib/wfs/parse-wfs.js +41 -0
- package/dist/es5/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/es5/lib/wmts/parse-wmts.js +41 -0
- package/dist/es5/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/es5/wip/arcgis-feature-service.js.map +1 -1
- package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js +2 -1
- package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
- package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js +2 -1
- package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
- package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js +2 -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-csw-capabilities.js +2 -1
- package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-csw-domain.js +2 -1
- package/dist/esm/lib/parsers/csw/parse-csw-domain.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-csw-records.js +7 -6
- package/dist/esm/lib/parsers/csw/parse-csw-records.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 +2 -1
- package/dist/esm/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js +2 -1
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-features.js +2 -2
- package/dist/esm/lib/parsers/wms/parse-wms-features.js.map +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-layer-description.js +2 -1
- package/dist/esm/lib/parsers/wms/parse-wms-layer-description.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/lib/wfs/parse-wfs.js +28 -0
- package/dist/esm/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/esm/lib/wmts/parse-wmts.js +28 -0
- package/dist/esm/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js +2 -1
- package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
- package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js +2 -1
- package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
- package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js +2 -1
- package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.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/csw/parse-csw-capabilities.js +1 -1
- package/dist/lib/parsers/csw/parse-csw-domain.js +1 -1
- package/dist/lib/parsers/csw/parse-csw-records.js +6 -6
- package/dist/lib/parsers/csw/parse-exception-report.js +1 -1
- package/dist/lib/parsers/gml/parse-gml.js +1 -1
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +2 -1
- package/dist/lib/parsers/wms/parse-wms-features.js +1 -1
- package/dist/lib/parsers/wms/parse-wms-layer-description.js +1 -1
- 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 +84 -43
- 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/dist/lib/wfs/parse-wfs.d.ts +7 -0
- package/dist/lib/wfs/parse-wfs.d.ts.map +1 -0
- package/dist/lib/wfs/parse-wfs.js +32 -0
- package/dist/lib/wmts/parse-wmts.d.ts +7 -0
- package/dist/lib/wmts/parse-wmts.d.ts.map +1 -0
- package/dist/lib/wmts/parse-wmts.js +35 -0
- package/dist/wip/lib/wcs/parse-wcs-capabilities.js +1 -1
- package/dist/wip/lib/wfs/parse-wfs-capabilities.js +1 -1
- package/dist/wip/lib/wmts/parse-wmts-capabilities.js +1 -1
- package/package.json +6 -6
- package/src/lib/create-image-source.ts +1 -1
- package/src/lib/parsers/csw/parse-csw-capabilities.ts +1 -1
- package/src/lib/parsers/csw/parse-csw-domain.ts +1 -1
- package/src/lib/parsers/csw/parse-csw-records.ts +6 -6
- package/src/lib/parsers/csw/parse-exception-report.ts +1 -1
- package/src/lib/parsers/gml/parse-gml.ts +1 -1
- package/src/lib/parsers/wms/parse-wms-capabilities.ts +2 -1
- package/src/lib/parsers/wms/parse-wms-features.ts +1 -1
- package/src/lib/parsers/wms/parse-wms-layer-description.ts +1 -1
- 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/src/lib/wfs/parse-wfs.ts +34 -0
- package/src/lib/wmts/parse-wmts.ts +37 -0
- package/src/wip/lib/wcs/parse-wcs-capabilities.ts +1 -1
- package/src/wip/lib/wfs/parse-wfs-capabilities.ts +1 -1
- package/src/wip/lib/wmts/parse-wmts-capabilities.ts +1 -1
- 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
|
@@ -8,15 +8,21 @@ import { WMSLayerDescriptionLoader } from '../../../wip/wms-layer-description-lo
|
|
|
8
8
|
import { WMSErrorLoader } from '../../../wms-error-loader';
|
|
9
9
|
export class WMSService extends ImageSource {
|
|
10
10
|
constructor(props) {
|
|
11
|
+
var _props$substituteCRS;
|
|
11
12
|
super(props);
|
|
12
13
|
_defineProperty(this, "url", void 0);
|
|
14
|
+
_defineProperty(this, "substituteCRS84", void 0);
|
|
15
|
+
_defineProperty(this, "flipCRS", void 0);
|
|
13
16
|
_defineProperty(this, "wmsParameters", void 0);
|
|
14
17
|
_defineProperty(this, "vendorParameters", void 0);
|
|
15
18
|
_defineProperty(this, "capabilities", null);
|
|
16
19
|
_defineProperty(this, "loaders", [ImageLoader, WMSErrorLoader, WMSCapabilitiesLoader, WMSFeatureInfoLoader, WMSLayerDescriptionLoader]);
|
|
17
20
|
this.url = props.url;
|
|
21
|
+
this.substituteCRS84 = (_props$substituteCRS = props.substituteCRS84) !== null && _props$substituteCRS !== void 0 ? _props$substituteCRS : false;
|
|
22
|
+
this.flipCRS = ['EPSG:4326'];
|
|
18
23
|
this.wmsParameters = {
|
|
19
24
|
layers: undefined,
|
|
25
|
+
query_layers: undefined,
|
|
20
26
|
styles: undefined,
|
|
21
27
|
version: '1.3.0',
|
|
22
28
|
crs: 'EPSG:4326',
|
|
@@ -32,12 +38,7 @@ export class WMSService extends ImageSource {
|
|
|
32
38
|
return this.normalizeMetadata(capabilities);
|
|
33
39
|
}
|
|
34
40
|
async getImage(parameters) {
|
|
35
|
-
|
|
36
|
-
...parameters,
|
|
37
|
-
crs: parameters.srs
|
|
38
|
-
};
|
|
39
|
-
delete wmsParameters.srs;
|
|
40
|
-
return await this.getMap(wmsParameters);
|
|
41
|
+
return await this.getMap(parameters);
|
|
41
42
|
}
|
|
42
43
|
normalizeMetadata(capabilities) {
|
|
43
44
|
return capabilities;
|
|
@@ -102,12 +103,14 @@ export class WMSService extends ImageSource {
|
|
|
102
103
|
return this._getWMSUrl('GetCapabilities', options, vendorParameters);
|
|
103
104
|
}
|
|
104
105
|
getMapURL(wmsParameters, vendorParameters) {
|
|
106
|
+
wmsParameters = this._getWMS130Parameters(wmsParameters);
|
|
105
107
|
const options = {
|
|
106
108
|
version: this.wmsParameters.version,
|
|
107
|
-
styles: this.wmsParameters.styles,
|
|
108
|
-
crs: this.wmsParameters.crs,
|
|
109
109
|
format: this.wmsParameters.format,
|
|
110
110
|
transparent: this.wmsParameters.transparent,
|
|
111
|
+
layers: this.wmsParameters.layers,
|
|
112
|
+
styles: this.wmsParameters.styles,
|
|
113
|
+
crs: this.wmsParameters.crs,
|
|
111
114
|
...wmsParameters
|
|
112
115
|
};
|
|
113
116
|
return this._getWMSUrl('GetMap', options, vendorParameters);
|
|
@@ -115,10 +118,11 @@ export class WMSService extends ImageSource {
|
|
|
115
118
|
getFeatureInfoURL(wmsParameters, vendorParameters) {
|
|
116
119
|
const options = {
|
|
117
120
|
version: this.wmsParameters.version,
|
|
118
|
-
srs: this.wmsParameters.crs,
|
|
119
|
-
format: this.wmsParameters.format,
|
|
120
121
|
info_format: this.wmsParameters.info_format,
|
|
122
|
+
layers: this.wmsParameters.layers,
|
|
123
|
+
query_layers: this.wmsParameters.query_layers,
|
|
121
124
|
styles: this.wmsParameters.styles,
|
|
125
|
+
crs: this.wmsParameters.crs,
|
|
122
126
|
...wmsParameters
|
|
123
127
|
};
|
|
124
128
|
return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);
|
|
@@ -165,18 +169,54 @@ export class WMSService extends ImageSource {
|
|
|
165
169
|
if (key !== 'transparent' || value) {
|
|
166
170
|
url += first ? '?' : '&';
|
|
167
171
|
first = false;
|
|
168
|
-
url += this.
|
|
172
|
+
url += this._getURLParameter(key, value, wmsParameters);
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
175
|
return encodeURI(url);
|
|
172
176
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
_getWMS130Parameters(wmsParameters) {
|
|
178
|
+
const newParameters = {
|
|
179
|
+
...wmsParameters
|
|
180
|
+
};
|
|
181
|
+
if (newParameters.srs) {
|
|
182
|
+
newParameters.crs = newParameters.crs || newParameters.srs;
|
|
183
|
+
delete newParameters.srs;
|
|
184
|
+
}
|
|
185
|
+
return newParameters;
|
|
186
|
+
}
|
|
187
|
+
_getURLParameter(key, value, wmsParameters) {
|
|
188
|
+
switch (key) {
|
|
189
|
+
case 'crs':
|
|
190
|
+
if (wmsParameters.version !== '1.3.0') {
|
|
191
|
+
key = 'srs';
|
|
192
|
+
} else if (this.substituteCRS84 && value === 'EPSG:4326') {
|
|
193
|
+
value = 'CRS:84';
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
case 'srs':
|
|
197
|
+
if (wmsParameters.version === '1.3.0') {
|
|
198
|
+
key = 'crs';
|
|
199
|
+
}
|
|
200
|
+
break;
|
|
201
|
+
case 'bbox':
|
|
202
|
+
const bbox = this._flipBoundingBox(value, wmsParameters);
|
|
203
|
+
if (bbox) {
|
|
204
|
+
value = bbox;
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
default:
|
|
176
208
|
}
|
|
177
209
|
key = key.toUpperCase();
|
|
178
210
|
return Array.isArray(value) ? "".concat(key, "=").concat(value.join(',')) : "".concat(key, "=").concat(value ? String(value) : '');
|
|
179
211
|
}
|
|
212
|
+
_flipBoundingBox(bboxValue, wmsParameters) {
|
|
213
|
+
if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
const flipCoordinates = wmsParameters.version === '1.3.0' && this.flipCRS.includes(wmsParameters.crs || '') && !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');
|
|
217
|
+
const bbox = bboxValue;
|
|
218
|
+
return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;
|
|
219
|
+
}
|
|
180
220
|
async _fetchArrayBuffer(url) {
|
|
181
221
|
const response = await this.fetch(url);
|
|
182
222
|
const arrayBuffer = await response.arrayBuffer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","_defineProperty","url","wmsParameters","layers","undefined","styles","version","crs","format","info_format","transparent","vendorParameters","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","srs","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","Object","entries","_getParameterValue","encodeURI","toUpperCase","Array","isArray","concat","join","String","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","includes","wms","throwOnError","error","parseSync","Error","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageSourceMetadata, GetImageParameters} from '../../sources/image-source';\nimport type {ImageSourceProps} from '../../sources/image-source';\nimport {ImageSource} from '../../sources/image-source';\n\nimport type {WMSCapabilities} from '../../../wms-capabilities-loader';\nimport type {WMSFeatureInfo} from '../../../wip/wms-feature-info-loader';\nimport type {WMSLayerDescription} from '../../../wip/wms-layer-description-loader';\n\nimport {WMSCapabilitiesLoader} from '../../../wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from '../../../wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from '../../../wip/wms-layer-description-loader';\n\nimport type {WMSLoaderOptions} from '../../../wms-error-loader';\nimport {WMSErrorLoader} from '../../../wms-error-loader';\n\n/** Static WMS parameters (not viewport or selected pixel dependent) that can be provided as defaults */\nexport type WMSParameters = {\n /** WMS version */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render */\n layers?: string[];\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image */\n format?: 'image/png';\n /** Requested MIME type of returned feature info */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** Styling - Not yet supported */\n styles?: unknown;\n /** Any additional parameters specific to this WMSService */\n transparent?: boolean;\n};\n\ntype WMSCommonParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = WMSCommonParameters;\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = WMSCommonParameters & {\n /** Layers to render */\n layers: string | string[];\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** Coordinate Reference System for the image (not the bounding box). */\n crs?: string;\n /** Styling */\n styles?: unknown;\n /** Don't render background when no data */\n transparent?: boolean;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = WMSCommonParameters & {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** list of layers to query (could be different from rendered layers) */\n query_layers: string[];\n /** Requested MIME type of returned feature info */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n\n /** Layers to render */\n layers: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = WMSCommonParameters;\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = WMSCommonParameters;\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSServiceProps = ImageSourceProps & {\n /** Base URL to the service */\n url: string;\n /** Default WMS parameters. If not provided here, must be provided in the various request */\n wmsParameters?: WMSParameters;\n /** Any additional service specific parameters */\n vendorParameters?: Record<string, unknown>;\n};\n\n/**\n * The WMSService class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSService extends ImageSource {\n static type: 'wms' = 'wms';\n static testURL = (url: string): boolean => url.toLowerCase().includes('wms');\n\n readonly url: string;\n /** Default static WMS parameters */\n wmsParameters: Required<WMSParameters>;\n /** Default static vendor parameters */\n vendorParameters?: Record<string, unknown>;\n\n capabilities: WMSCapabilities | null = null;\n\n /** A list of loaders used by the WMSService methods */\n readonly loaders = [\n ImageLoader,\n WMSErrorLoader,\n WMSCapabilitiesLoader,\n WMSFeatureInfoLoader,\n WMSLayerDescriptionLoader\n ];\n\n /** Create a WMSService */\n constructor(props: WMSServiceProps) {\n super(props);\n\n // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters\n // This would make pasting in any WMS URL more likely to make this class just work.\n // const {baseUrl, parameters} = this._parseWMSUrl(props.url);\n\n this.url = props.url;\n\n this.wmsParameters = {\n layers: undefined!,\n styles: undefined,\n version: '1.3.0',\n crs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n transparent: undefined!,\n ...props.wmsParameters\n };\n\n this.vendorParameters = props.vendorParameters || {};\n }\n\n // ImageSource implementation\n async getMetadata(): Promise<ImageSourceMetadata> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n // WMS 1.3.0 renamed SRS to CRS (sigh...)\n const wmsParameters = {...parameters, crs: parameters.srs};\n delete wmsParameters.srs;\n return await this.getMap(wmsParameters);\n }\n\n normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata {\n return capabilities;\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return new TextDecoder().decode(arrayBuffer);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\n ...wmsParameters\n };\n return this._getWMSUrl('GetMap', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n version: this.wmsParameters.version,\n // layers: this.props.layers,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n // query_layers: [],\n srs: this.wmsParameters.crs,\n format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n styles: this.wmsParameters.styles,\n ...wmsParameters\n };\n return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n version: this.wmsParameters.version,\n // format?\n ...wmsParameters\n };\n return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n const [baseUrl, search] = url.split('?');\n const searchParams = search.split('&');\n\n const parameters: Record<string, unknown> = {};\n for (const parameter of searchParams) {\n const [key, value] = parameter.split('=');\n parameters[key] = value;\n }\n\n return {url: baseUrl, parameters};\n }\n\n /**\n * Generate a URL with parameters\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * @note at the moment, only URLs with parameters are supported (no XML payloads)\n * */\n protected _getWMSUrl(\n request: string,\n wmsParameters: WMSCommonParameters & {[key: string]: unknown},\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.url;\n let first = true;\n\n // Add any vendor searchParams\n const allParameters = {\n service: 'WMS',\n version: wmsParameters.version,\n request,\n ...wmsParameters,\n ...this.vendorParameters,\n ...vendorParameters\n };\n\n // Encode the keys\n for (const [key, value] of Object.entries(allParameters)) {\n // hack to preserve test cases. Not super clear if keys should be included when values are undefined\n if (key !== 'transparent' || value) {\n url += first ? '?' : '&';\n first = false;\n url += this._getParameterValue(wmsParameters.version!, key, value);\n }\n }\n\n return encodeURI(url);\n }\n\n _getParameterValue(version: string, key: string, value: unknown): string {\n // SRS parameter changed to CRS in 1.3.0, in non-backwards compatible way (sigh...)\n if (key === 'crs' && version !== '1.3.0') {\n key = 'srs';\n }\n\n key = key.toUpperCase();\n\n // TODO - in v1.3.0 only, the order of parameters for BBOX depends on whether the CRS definition has flipped axes\n // You will see this in the GetCapabilities request at 1.3.0 - the response should show the flipped axes.\n // BBOX=xmin,ymin,xmax,ymax NON-FLIPPED\n // BBOX=ymin,xmin,ymax,xmax FLIPPED\n // / EPSG:4326 needs to have flipped axes. 4326 1 WGS 84 Latitude North Longitude East\n // 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.\n // CRS:84 was introduced with the publication of the WMS 1.3.0 specification, to overcome this issue.\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\n protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return arrayBuffer;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n const loadOptions = mergeLoaderOptions<WMSLoaderOptions>(this.loadOptions, {\n wms: {throwOnError: true}\n });\n const error = WMSErrorLoader.parseSync(arrayBuffer, loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAKA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAI3D,SAAQC,WAAW,QAAO,4BAA4B;AAMtD,SAAQC,qBAAqB,QAAO,kCAAkC;AACtE,SAAQC,oBAAoB,QAAO,sCAAsC;AACzE,SAAQC,yBAAyB,QAAO,2CAA2C;AAGnF,SAAQC,cAAc,QAAO,2BAA2B;AAuGxD,OAAO,MAAMC,UAAU,SAASL,WAAW,CAAC;EAsB1CM,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAbwB,IAAI;IAAAA,eAAA,kBAGxB,CACjBV,WAAW,EACXM,cAAc,EACdH,qBAAqB,EACrBC,oBAAoB,EACpBC,yBAAyB,CAC1B;IAUC,IAAI,CAACM,GAAG,GAAGF,KAAK,CAACE,GAAG;IAEpB,IAAI,CAACC,aAAa,GAAG;MACnBC,MAAM,EAAEC,SAAU;MAClBC,MAAM,EAAED,SAAS;MACjBE,OAAO,EAAE,OAAO;MAChBC,GAAG,EAAE,WAAW;MAChBC,MAAM,EAAE,WAAW;MACnBC,WAAW,EAAE,YAAY;MACzBC,WAAW,EAAEN,SAAU;MACvB,GAAGL,KAAK,CAACG;IACX,CAAC;IAED,IAAI,CAACS,gBAAgB,GAAGZ,KAAK,CAACY,gBAAgB,IAAI,CAAC,CAAC;EACtD;EAGA,MAAMC,WAAWA,CAAA,EAAiC;IAChD,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACC,eA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AE,CAACN,QAAQ,CAAC,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","_props$substituteCRS","_defineProperty","url","substituteCRS84","flipCRS","wmsParameters","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","vendorParameters","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_getWMS130Parameters","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","Object","entries","_getURLParameter","encodeURI","newParameters","srs","bbox","_flipBoundingBox","toUpperCase","Array","isArray","concat","join","String","bboxValue","length","flipCoordinates","includes","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","wms","throwOnError","error","parseSync","Error","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageSourceMetadata, GetImageParameters} from '../../sources/image-source';\nimport type {ImageSourceProps} from '../../sources/image-source';\nimport {ImageSource} from '../../sources/image-source';\n\nimport type {WMSCapabilities} from '../../../wms-capabilities-loader';\nimport type {WMSFeatureInfo} from '../../../wip/wms-feature-info-loader';\nimport type {WMSLayerDescription} from '../../../wip/wms-layer-description-loader';\n\nimport {WMSCapabilitiesLoader} from '../../../wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from '../../../wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from '../../../wip/wms-layer-description-loader';\n\nimport type {WMSLoaderOptions} from '../../../wms-error-loader';\nimport {WMSErrorLoader} from '../../../wms-error-loader';\n\n/**\n * \"Static\" WMS parameters (not viewport or selected pixel dependent)\n * These can be provided as defaults in the WMSService constructor\n */\nexport type WMSParameters = {\n /** WMS version (all requests) */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render (GetMap, GetFeatureInfo) */\n layers?: string[];\n /** list of layers to query.. (GetFeatureInfo) */\n query_layers?: string[];\n\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image (GetMap, GetLegendGraphic) */\n format?: 'image/png';\n /** Requested MIME type of returned feature info (GetFeatureInfo) */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** Styling - Not yet supported */\n styles?: unknown;\n /** Any additional parameters specific to this WMSService (GetMap) */\n transparent?: boolean;\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** Layers to render - can be provided in service constructor */\n layers?: string | string[];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n /** Styling. can be provided in service constructor */\n styles?: unknown;\n /** Don't render background when no data. can be provided in service constructor */\n transparent?: boolean;\n /** requested format for the return image. can be provided in service constructor */\n format?: 'image/png';\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetMapViewParameters = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n};\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** MIME type of returned feature info. Can be specified in service constructor */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** list of layers to query. Required but can be specified in service constructor. */\n query_layers?: string[];\n /** Layers to render. Required, but can be specified in service constructor */\n layers?: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetFeatureInfoViewParameters = {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSServiceProps = ImageSourceProps & {\n /** Base URL to the service */\n url: string;\n /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */\n substituteCRS84?: boolean;\n\n /** Default WMS parameters. If not provided here, must be provided in the various request */\n wmsParameters?: WMSParameters;\n /** Any additional service specific parameters */\n vendorParameters?: Record<string, unknown>;\n};\n\n/**\n * The WMSService class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSService extends ImageSource<WMSServiceProps> {\n static type: 'wms' = 'wms';\n static testURL = (url: string): boolean => url.toLowerCase().includes('wms');\n\n /** Base URL to the service */\n readonly url: string;\n\n /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */\n substituteCRS84: boolean;\n /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */\n flipCRS: string[];\n\n /** Default static WMS parameters */\n wmsParameters: Required<WMSParameters>;\n /** Default static vendor parameters */\n vendorParameters?: Record<string, unknown>;\n\n capabilities: WMSCapabilities | null = null;\n\n /** A list of loaders used by the WMSService methods */\n readonly loaders = [\n ImageLoader,\n WMSErrorLoader,\n WMSCapabilitiesLoader,\n WMSFeatureInfoLoader,\n WMSLayerDescriptionLoader\n ];\n\n /** Create a WMSService */\n constructor(props: WMSServiceProps) {\n super(props);\n\n // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters\n // This would make pasting in any WMS URL more likely to make this class just work.\n // const {baseUrl, parameters} = this._parseWMSUrl(props.url);\n\n this.url = props.url;\n\n this.substituteCRS84 = props.substituteCRS84 ?? false;\n this.flipCRS = ['EPSG:4326'];\n\n this.wmsParameters = {\n layers: undefined!,\n query_layers: undefined!,\n styles: undefined,\n version: '1.3.0',\n crs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n transparent: undefined!,\n ...props.wmsParameters\n };\n\n this.vendorParameters = props.vendorParameters || {};\n }\n\n // ImageSource implementation\n async getMetadata(): Promise<ImageSourceMetadata> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n return await this.getMap(parameters);\n }\n\n normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata {\n return capabilities;\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return new TextDecoder().decode(arrayBuffer);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n wmsParameters = this._getWMS130Parameters(wmsParameters);\n const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\n layers: this.wmsParameters.layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n ...wmsParameters\n };\n return this._getWMSUrl('GetMap', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n version: this.wmsParameters.version,\n // query_layers: [],\n // format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n layers: this.wmsParameters.layers,\n query_layers: this.wmsParameters.query_layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n ...wmsParameters\n };\n return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n version: this.wmsParameters.version,\n // format?\n ...wmsParameters\n };\n return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n const [baseUrl, search] = url.split('?');\n const searchParams = search.split('&');\n\n const parameters: Record<string, unknown> = {};\n for (const parameter of searchParams) {\n const [key, value] = parameter.split('=');\n parameters[key] = value;\n }\n\n return {url: baseUrl, parameters};\n }\n\n /**\n * Generate a URL with parameters\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * @note at the moment, only URLs with parameters are supported (no XML payloads)\n * */\n protected _getWMSUrl(\n request: string,\n wmsParameters: {version?: '1.3.0' | '1.1.1'; [key: string]: unknown},\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.url;\n let first = true;\n\n // Add any vendor searchParams\n const allParameters = {\n service: 'WMS',\n version: wmsParameters.version,\n request,\n ...wmsParameters,\n ...this.vendorParameters,\n ...vendorParameters\n };\n\n // Encode the keys\n for (const [key, value] of Object.entries(allParameters)) {\n // hack to preserve test cases. Not super clear if keys should be included when values are undefined\n if (key !== 'transparent' || value) {\n url += first ? '?' : '&';\n first = false;\n url += this._getURLParameter(key, value, wmsParameters);\n }\n }\n\n return encodeURI(url);\n }\n\n _getWMS130Parameters<ParametersT extends {crs?: string; srs?: string}>(\n wmsParameters: ParametersT\n ): ParametersT {\n const newParameters = {...wmsParameters};\n if (newParameters.srs) {\n newParameters.crs = newParameters.crs || newParameters.srs;\n delete newParameters.srs;\n }\n return newParameters;\n }\n\n // eslint-disable-complexity\n _getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string {\n // Substitute by key\n switch (key) {\n case 'crs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version !== '1.3.0') {\n key = 'srs';\n } else if (this.substituteCRS84 && value === 'EPSG:4326') {\n /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */\n // Substitute by value\n value = 'CRS:84';\n }\n break;\n\n case 'srs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version === '1.3.0') {\n key = 'crs';\n }\n break;\n\n case 'bbox':\n // Coordinate order is flipped for certain CRS in WMS 1.3.0\n const bbox = this._flipBoundingBox(value, wmsParameters);\n if (bbox) {\n value = bbox;\n }\n break;\n\n default:\n // do nothing\n }\n\n key = key.toUpperCase();\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\n /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */\n _flipBoundingBox(\n bboxValue: unknown,\n wmsParameters: WMSParameters\n ): [number, number, number, number] | null {\n // Sanity checks\n if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {\n return null;\n }\n\n const flipCoordinates =\n // Only affects WMS 1.3.0\n wmsParameters.version === '1.3.0' &&\n // Flip if we are dealing with a CRS that was flipped in 1.3.0\n this.flipCRS.includes(wmsParameters.crs || '') &&\n // Don't flip if we are subsituting EPSG:4326 with CRS:84\n !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');\n\n const bbox = bboxValue as [number, number, number, number];\n return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;\n }\n\n /** Fetches an array buffer and checks the response (boilerplate reduction) */\n protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return arrayBuffer;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n const loadOptions = mergeLoaderOptions<WMSLoaderOptions>(this.loadOptions, {\n wms: {throwOnError: true}\n });\n const error = WMSErrorLoader.parseSync(arrayBuffer, loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAIA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAI3D,SAAQC,WAAW,QAAO,4BAA4B;AAMtD,SAAQC,qBAAqB,QAAO,kCAAkC;AACtE,SAAQC,oBAAoB,QAAO,sCAAsC;AACzE,SAAQC,yBAAyB,QAAO,2CAA2C;AAGnF,SAAQC,cAAc,QAAO,2BAA2B;AAiJxD,OAAO,MAAMC,UAAU,SAASL,WAAW,CAAkB;EA6B3DM,WAAWA,CAACC,KAAsB,EAAE;IAAA,IAAAC,oBAAA;IAClC,KAAK,CAACD,KAAK,CAAC;IAACE,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAbwB,IAAI;IAAAA,eAAA,kBAGxB,CACjBX,WAAW,EACXM,cAAc,EACdH,qBAAqB,EACrBC,oBAAoB,EACpBC,yBAAyB,CAC1B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ACH,QAAkB,EAAEE,WAAwB,EAAQ;IAC3E,MAAMiD,WAAW,GAAGnD,QAAQ,CAACoD,OAAO,CAAC,cAAc,CAAC;IACpD,IAAI,CAACpD,QAAQ,CAACqD,EAAE,IAAIjF,cAAc,CAACkF,SAAS,CAACL,QAAQ,CAACE,WAAW,CAAC,EAAE;MAElE,MAAM9C,WAAW,GAAGtC,kBAAkB,CAAmB,IAAI,CAACsC,WAAW,EAAE;QACzEkD,GAAG,EAAE;UAACC,YAAY,EAAE;QAAI;MAC1B,CAAC,CAAC;MACF,MAAMC,KAAK,GAAGrF,cAAc,CAACsF,SAAS,CAACxD,WAAW,EAAEG,WAAW,CAAC;MAChE,MAAM,IAAIsD,KAAK,CAACF,KAAK,CAAC;IACxB;EACF;EAGUlD,WAAWA,CAACL,WAAwB,EAAS;IACrD,MAAMuD,KAAK,GAAGrF,cAAc,CAACsF,SAAS,CAACxD,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACrE,OAAO,IAAIsD,KAAK,CAACF,KAAK,CAAC;EACzB;AACF;AAAChF,eAAA,CArYYJ,UAAU,UACA,KAAK;AAAAI,eAAA,CADfJ,UAAU,aAEHK,GAAW,IAAcA,GAAG,CAACkF,WAAW,CAAC,CAAC,CAACX,QAAQ,CAAC,KAAK,CAAC"}
|
|
@@ -3,11 +3,31 @@ export class DataSource {
|
|
|
3
3
|
constructor(props) {
|
|
4
4
|
_defineProperty(this, "fetch", void 0);
|
|
5
5
|
_defineProperty(this, "loadOptions", void 0);
|
|
6
|
+
_defineProperty(this, "_needsRefresh", true);
|
|
7
|
+
_defineProperty(this, "props", void 0);
|
|
8
|
+
this.props = {
|
|
9
|
+
...props
|
|
10
|
+
};
|
|
6
11
|
this.loadOptions = {
|
|
7
12
|
...props.loadOptions
|
|
8
13
|
};
|
|
9
14
|
this.fetch = getFetchFunction(this.loadOptions);
|
|
10
15
|
}
|
|
16
|
+
setProps(props) {
|
|
17
|
+
this.props = Object.assign(this.props, props);
|
|
18
|
+
this.setNeedsRefresh();
|
|
19
|
+
}
|
|
20
|
+
setNeedsRefresh() {
|
|
21
|
+
this._needsRefresh = true;
|
|
22
|
+
}
|
|
23
|
+
getNeedsRefresh() {
|
|
24
|
+
let clear = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
25
|
+
const needsRefresh = this._needsRefresh;
|
|
26
|
+
if (clear) {
|
|
27
|
+
this._needsRefresh = false;
|
|
28
|
+
}
|
|
29
|
+
return needsRefresh;
|
|
30
|
+
}
|
|
11
31
|
}
|
|
12
32
|
export function getFetchFunction(options) {
|
|
13
33
|
const fetchFunction = options === null || options === void 0 ? void 0 : options.fetch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.js","names":["DataSource","constructor","props","_defineProperty","loadOptions","fetch","getFetchFunction","options","fetchFunction","url","fetchOptions"],"sources":["../../../../src/lib/sources/data-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\n\nexport type DataSourceProps = {\n /** LoaderOptions provide an option to override `fetch`. Will also be passed to any sub loaders */\n loadOptions?: LoaderOptions;\n};\n\n/** base class of all data sources */\nexport abstract class DataSource {\n /** A resolved fetch function extracted from loadOptions prop */\n fetch: (url: string, options?: RequestInit) => Promise<Response>;\n /** The actual load options, if calling a loaders.gl loader */\n loadOptions: LoaderOptions;\n\n constructor(props:
|
|
1
|
+
{"version":3,"file":"data-source.js","names":["DataSource","constructor","props","_defineProperty","loadOptions","fetch","getFetchFunction","setProps","Object","assign","setNeedsRefresh","_needsRefresh","getNeedsRefresh","clear","arguments","length","undefined","needsRefresh","options","fetchFunction","url","fetchOptions"],"sources":["../../../../src/lib/sources/data-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\n\nexport type DataSourceProps = {\n /** LoaderOptions provide an option to override `fetch`. Will also be passed to any sub loaders */\n loadOptions?: LoaderOptions;\n};\n\n/** base class of all data sources */\nexport abstract class DataSource<PropsT extends DataSourceProps> {\n /** A resolved fetch function extracted from loadOptions prop */\n fetch: (url: string, options?: RequestInit) => Promise<Response>;\n /** The actual load options, if calling a loaders.gl loader */\n loadOptions: LoaderOptions;\n _needsRefresh: boolean = true;\n\n props: PropsT;\n\n constructor(props: PropsT) {\n this.props = {...props};\n this.loadOptions = {...props.loadOptions};\n this.fetch = getFetchFunction(this.loadOptions);\n }\n\n setProps(props: PropsT) {\n this.props = Object.assign(this.props, props);\n // TODO - add a shallow compare to avoid setting refresh if no change?\n this.setNeedsRefresh();\n }\n\n /** Mark this data source as needing a refresh (redraw) */\n setNeedsRefresh(): void {\n this._needsRefresh = true;\n }\n\n /**\n * Does this data source need refreshing?\n * @note The specifics of the refresh mechanism depends on type of data source\n */\n getNeedsRefresh(clear: boolean = true) {\n const needsRefresh = this._needsRefresh;\n if (clear) {\n this._needsRefresh = false;\n }\n return needsRefresh;\n }\n}\n\n/**\n * Gets the current fetch function from options\n * @todo - move to loader-utils module\n * @todo - use in core module counterpart\n * @param options\n * @param context\n */\nexport function getFetchFunction(options?: LoaderOptions) {\n const fetchFunction = options?.fetch;\n\n // options.fetch can be a function\n if (fetchFunction && typeof fetchFunction === 'function') {\n return (url: string, fetchOptions?: RequestInit) => fetchFunction(url, fetchOptions);\n }\n\n // options.fetch can be an options object, use global fetch with those options\n const fetchOptions = options?.fetch;\n if (fetchOptions && typeof fetchOptions !== 'function') {\n return (url) => fetch(url, fetchOptions);\n }\n\n // else return the global fetch function\n return (url) => fetch(url);\n}\n"],"mappings":";AAUA,OAAO,MAAeA,UAAU,CAAiC;EAS/DC,WAAWA,CAACC,KAAa,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,wBAJF,IAAI;IAAAA,eAAA;IAK3B,IAAI,CAACD,KAAK,GAAG;MAAC,GAAGA;IAAK,CAAC;IACvB,IAAI,CAACE,WAAW,GAAG;MAAC,GAAGF,KAAK,CAACE;IAAW,CAAC;IACzC,IAAI,CAACC,KAAK,GAAGC,gBAAgB,CAAC,IAAI,CAACF,WAAW,CAAC;EACjD;EAEAG,QAAQA,CAACL,KAAa,EAAE;IACtB,IAAI,CAACA,KAAK,GAAGM,MAAM,CAACC,MAAM,CAAC,IAAI,CAACP,KAAK,EAAEA,KAAK,CAAC;IAE7C,IAAI,CAACQ,eAAe,CAAC,CAAC;EACxB;EAGAA,eAAeA,CAAA,EAAS;IACtB,IAAI,CAACC,aAAa,GAAG,IAAI;EAC3B;EAMAC,eAAeA,CAAA,EAAwB;IAAA,IAAvBC,KAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;IACnC,MAAMG,YAAY,GAAG,IAAI,CAACN,aAAa;IACvC,IAAIE,KAAK,EAAE;MACT,IAAI,CAACF,aAAa,GAAG,KAAK;IAC5B;IACA,OAAOM,YAAY;EACrB;AACF;AASA,OAAO,SAASX,gBAAgBA,CAACY,OAAuB,EAAE;EACxD,MAAMC,aAAa,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEb,KAAK;EAGpC,IAAIc,aAAa,IAAI,OAAOA,aAAa,KAAK,UAAU,EAAE;IACxD,OAAO,CAACC,GAAW,EAAEC,YAA0B,KAAKF,aAAa,CAACC,GAAG,EAAEC,YAAY,CAAC;EACtF;EAGA,MAAMA,YAAY,GAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEb,KAAK;EACnC,IAAIgB,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;IACtD,OAAQD,GAAG,IAAKf,KAAK,CAACe,GAAG,EAAEC,YAAY,CAAC;EAC1C;EAGA,OAAQD,GAAG,IAAKf,KAAK,CAACe,GAAG,CAAC;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.js","names":["DataSource","ImageSource"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n
|
|
1
|
+
{"version":3,"file":"image-source.js","names":["DataSource","ImageSource"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n crs?: string[];\n boundingBox?: [number, number, number, number];\n layers?: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** crs for the image (not the bounding box) */\n crs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource<PropsT extends ImageSourceProps> extends DataSource<PropsT> {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":"AAIA,SAAQA,UAAU,QAAO,eAAe;AAwExC,OAAO,MAAeC,WAAW,SAA0CD,UAAU,CAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-source.js","names":["DataSource","TileSource"],"sources":["../../../../src/lib/sources/tile-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an TileSourceMetadata.\n */\nexport type TileSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layer: {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n };\n};\n\nexport type TileSourceLayer = {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n};\n\nexport type GetTileParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n zoom: number;\n /** tile x coordinate */\n x: number;\n /** tile y coordinate */\n y: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n/**\n * MapTileSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class TileSource extends DataSource {\n abstract getMetadata(): Promise<TileSourceMetadata>;\n abstract getTile(parameters: GetTileParameters): Promise<ImageType>;\n}\n"],"mappings":"AAGA,SAAQA,UAAU,
|
|
1
|
+
{"version":3,"file":"tile-source.js","names":["DataSource","TileSource"],"sources":["../../../../src/lib/sources/tile-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {DataSource, DataSourceProps} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an TileSourceMetadata.\n */\nexport type TileSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layer: {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n };\n};\n\nexport type TileSourceLayer = {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n};\n\nexport type GetTileParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n zoom: number;\n /** tile x coordinate */\n x: number;\n /** tile y coordinate */\n y: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\ntype TileSourceProps = DataSourceProps;\n\n/**\n * MapTileSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class TileSource<PropsT extends TileSourceProps> extends DataSource<PropsT> {\n abstract getMetadata(): Promise<TileSourceMetadata>;\n abstract getTile(parameters: GetTileParameters): Promise<ImageType>;\n}\n"],"mappings":"AAGA,SAAQA,UAAU,QAAwB,eAAe;AAsDzD,OAAO,MAAeC,UAAU,SAAyCD,UAAU,CAAS"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { XMLLoader } from '@loaders.gl/xml';
|
|
2
|
+
export function parseWFSCapabilities(text, options) {
|
|
3
|
+
var _options, _XMLLoader$parseTextS;
|
|
4
|
+
options = {
|
|
5
|
+
...options,
|
|
6
|
+
xml: {
|
|
7
|
+
...((_options = options) === null || _options === void 0 ? void 0 : _options.xml),
|
|
8
|
+
removeNSPrefix: true
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, options);
|
|
12
|
+
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
13
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
14
|
+
}
|
|
15
|
+
function uncapitalizeKeys(object) {
|
|
16
|
+
if (object && typeof object === 'object') {
|
|
17
|
+
const newObject = {};
|
|
18
|
+
for (const [key, value] of Object.entries(object)) {
|
|
19
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
20
|
+
}
|
|
21
|
+
return newObject;
|
|
22
|
+
}
|
|
23
|
+
return object;
|
|
24
|
+
}
|
|
25
|
+
function uncapitalize(str) {
|
|
26
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=parse-wfs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wfs.js","names":["XMLLoader","parseWFSCapabilities","text","options","_options","_XMLLoader$parseTextS","xml","removeNSPrefix","parsedXML","parseTextSync","call","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../src/lib/wfs/parse-wfs.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\nexport type WFSCapabilities = {};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWFSCapabilities(text: string, options): WFSCapabilities {\n // Remove namespaces in XML\n options = {...options, xml: {...options?.xml, removeNSPrefix: true}};\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return uncapitalizeKeys(xmlCapabilities);\n}\n\n/** Uncapitalize all keys of an object */\nfunction uncapitalizeKeys(object: any): any {\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n\n/** Uncapitalize first letter of a string */\nfunction uncapitalize(str: string): string {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAQzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA,IAAAC,QAAA,EAAAC,qBAAA;EAE3EF,OAAO,GAAG;IAAC,GAAGA,OAAO;IAAEG,GAAG,EAAE;MAAC,KAAAF,QAAA,GAAGD,OAAO,cAAAC,QAAA,uBAAPA,QAAA,CAASE,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC;EACpE,MAAMC,SAAS,IAAAH,qBAAA,GAAGL,SAAS,CAACS,aAAa,cAAAJ,qBAAA,uBAAvBA,qBAAA,CAAAK,IAAA,CAAAV,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMQ,eAAoB,GAAGH,SAAS,CAACI,YAAY,IAAIJ,SAAS;EAChE,OAAOK,gBAAgB,CAACF,eAAe,CAAC;AAC1C;AAGA,SAASE,gBAAgBA,CAACC,MAAW,EAAO;EAC1C,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;MACjDC,SAAS,CAACK,YAAY,CAACJ,GAAG,CAAC,CAAC,GAAGH,gBAAgB,CAACI,KAAK,CAAC;IACxD;IACA,OAAOF,SAAS;EAClB;EACA,OAAOD,MAAM;AACf;AAGA,SAASM,YAAYA,CAACC,GAAW,EAAU;EACzC,OAAO,OAAOA,GAAG,KAAK,QAAQ,GAAGA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AACnF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { XMLLoader } from '@loaders.gl/xml';
|
|
2
|
+
export function parseWMTSCapabilities(text, options) {
|
|
3
|
+
var _options, _XMLLoader$parseTextS;
|
|
4
|
+
options = {
|
|
5
|
+
...options,
|
|
6
|
+
xml: {
|
|
7
|
+
...((_options = options) === null || _options === void 0 ? void 0 : _options.xml),
|
|
8
|
+
removeNSPrefix: true
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, options);
|
|
12
|
+
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
13
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
14
|
+
}
|
|
15
|
+
function uncapitalizeKeys(object) {
|
|
16
|
+
if (object && typeof object === 'object') {
|
|
17
|
+
const newObject = {};
|
|
18
|
+
for (const [key, value] of Object.entries(object)) {
|
|
19
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
20
|
+
}
|
|
21
|
+
return newObject;
|
|
22
|
+
}
|
|
23
|
+
return object;
|
|
24
|
+
}
|
|
25
|
+
function uncapitalize(str) {
|
|
26
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=parse-wmts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wmts.js","names":["XMLLoader","parseWMTSCapabilities","text","options","_options","_XMLLoader$parseTextS","xml","removeNSPrefix","parsedXML","parseTextSync","call","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../src/lib/wmts/parse-wmts.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\nexport type WMTSCapabilities = {};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n // Remove namespaces in XML\n options = {...options, xml: {...options?.xml, removeNSPrefix: true}};\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return uncapitalizeKeys(xmlCapabilities);\n}\n\nfunction uncapitalizeKeys(object: any): any {\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n\n/**\n * Uncapitalize first letter of a string\n * @param {string} str\n * @returns {string}\n */\nfunction uncapitalize(str: string): string {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAQzC,OAAO,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAAA,IAAAC,QAAA,EAAAC,qBAAA;EAE7EF,OAAO,GAAG;IAAC,GAAGA,OAAO;IAAEG,GAAG,EAAE;MAAC,KAAAF,QAAA,GAAGD,OAAO,cAAAC,QAAA,uBAAPA,QAAA,CAASE,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC;EACpE,MAAMC,SAAS,IAAAH,qBAAA,GAAGL,SAAS,CAACS,aAAa,cAAAJ,qBAAA,uBAAvBA,qBAAA,CAAAK,IAAA,CAAAV,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMQ,eAAoB,GAAGH,SAAS,CAACI,YAAY,IAAIJ,SAAS;EAChE,OAAOK,gBAAgB,CAACF,eAAe,CAAC;AAC1C;AAEA,SAASE,gBAAgBA,CAACC,MAAW,EAAO;EAC1C,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;MACjDC,SAAS,CAACK,YAAY,CAACJ,GAAG,CAAC,CAAC,GAAGH,gBAAgB,CAACI,KAAK,CAAC;IACxD;IACA,OAAOF,SAAS;EAClB;EACA,OAAOD,MAAM;AACf;AAOA,SAASM,YAAYA,CAACC,GAAW,EAAU;EACzC,OAAO,OAAOA,GAAG,KAAK,QAAQ,GAAGA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AACnF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { XMLLoader } from '@loaders.gl/xml';
|
|
2
2
|
export function parseWCSCapabilities(text, options) {
|
|
3
|
-
|
|
3
|
+
var _XMLLoader$parseTextS;
|
|
4
|
+
const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, {
|
|
4
5
|
...options,
|
|
5
6
|
xml: {
|
|
6
7
|
...(options === null || options === void 0 ? void 0 : options.xml),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wcs-capabilities.js","names":["XMLLoader","parseWCSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wcs/parse-wcs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WCS service - response to a WCS `GetCapabilities` data structure extracted from XML */\nexport type WCSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWCSCapabilities(text: string, options): WCSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,
|
|
1
|
+
{"version":3,"file":"parse-wcs-capabilities.js","names":["XMLLoader","parseWCSCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wcs/parse-wcs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WCS service - response to a WCS `GetCapabilities` data structure extracted from XML */\nexport type WCSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWCSCapabilities(text: string, options): WCSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA,IAAAC,qBAAA;EAC3E,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEK,GAAG,EAAE;MAAC,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC,CAAC;EAC7G,MAAMC,eAAoB,GAAGL,SAAS,CAACM,YAAY,IAAIN,SAAS;EAChE,OAAOK,eAAe;AACxB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { XMLLoader } from '@loaders.gl/xml';
|
|
2
2
|
export function parseWFSCapabilities(text, options) {
|
|
3
|
-
|
|
3
|
+
var _XMLLoader$parseTextS;
|
|
4
|
+
const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, {
|
|
4
5
|
...options,
|
|
5
6
|
xml: {
|
|
6
7
|
...(options === null || options === void 0 ? void 0 : options.xml),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wfs-capabilities.js","names":["XMLLoader","parseWFSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wfs/parse-wfs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */\nexport type WFSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWFSCapabilities(text: string, options): WFSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,
|
|
1
|
+
{"version":3,"file":"parse-wfs-capabilities.js","names":["XMLLoader","parseWFSCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wfs/parse-wfs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */\nexport type WFSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWFSCapabilities(text: string, options): WFSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA,IAAAC,qBAAA;EAC3E,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEK,GAAG,EAAE;MAClE,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGN,SAAS,CAACO,YAAY,IAAIP,SAAS;EAChE,OAAOM,eAAe;AACxB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { XMLLoader } from '@loaders.gl/xml';
|
|
2
2
|
export function parseWMTSCapabilities(text, options) {
|
|
3
|
-
|
|
3
|
+
var _XMLLoader$parseTextS;
|
|
4
|
+
const parsedXML = (_XMLLoader$parseTextS = XMLLoader.parseTextSync) === null || _XMLLoader$parseTextS === void 0 ? void 0 : _XMLLoader$parseTextS.call(XMLLoader, text, {
|
|
4
5
|
...options,
|
|
5
6
|
xml: {
|
|
6
7
|
...(options === null || options === void 0 ? void 0 : options.xml),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-wmts-capabilities.js","names":["XMLLoader","parseWMTSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wmts/parse-wmts-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n\n/** All capabilities of a WMTS service - response to a WMTS `GetCapabilities` data structure extracted from XML */\nexport type WMTSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: WMTSLayer[];\n };\n};\n\n/** A layer in WMTS */\nexport type WMTSLayer = {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: WMTSTileMatrixSet[];\n};\n\n/** A zoom level in WMTS */\nexport type WMTSTileMatrixSet = {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n };\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\n// export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n// const parsedXML = XMLLoader.parseTextSync(text, options);\n// const xmlCapabilities: any =\n// parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n// return extractCapabilities(xmlCapabilities);\n// }\n\n/** Extract typed capability data from XML */\n// function extractCapabilities(xml: any): WMTSCapabilities {\n// const capabilities: WMTSCapabilities = {\n// name: xml.Service?.Name || 'unnamed',\n// title: xml.Service?.Title,\n// keywords: [],\n// requests: {},\n// layer: extractLayer(xml.Capability?.Layer),\n// raw: xml\n// };\n\n// for (const keyword of xml.Service?.KeywordList?.Keyword || []) {\n// capabilities.keywords.push(keyword);\n// }\n\n// for (const [name, xmlRequest] of Object.entries(xml.Capability?.Request || {})) {\n// capabilities.requests[name] = extractRequest(name, xmlRequest);\n// }\n\n// return capabilities;\n// }\n\n// /** Extract typed request data from XML */\n// function extractRequest(name: string, xmlRequest: any): WMSRequest {\n// const format: string | string[] = xmlRequest?.Format;\n// const mimeTypes: string[] = Array.isArray(format) ? format : [format];\n// return {name, mimeTypes};\n// }\n\n// /** Extract request data */\n// function extractLayer(xmlLayer: any): WMSLayer {\n// const layer: WMSLayer = {\n// name: xmlLayer?.Name,\n// title: xmlLayer?.Title,\n// srs: xmlLayer?.SRS || [],\n// layers: []\n// };\n\n// // Single layer is not represented as array in XML\n// const xmlLayers = getXMLArray(xmlLayer?.Layer);\n\n// for (const xmlSubLayer of xmlLayers) {\n// layer.layers?.push(extractLayer(xmlSubLayer));\n// }\n\n// return layer;\n// }\n\n// function getXMLArray(xmlValue: any) {\n// if (Array.isArray(xmlValue)) {\n// return xmlValue;\n// }\n// if (xmlValue) {\n// return [xmlValue];\n// }\n// return [];\n// }\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAyFzC,OAAO,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAC7E,MAAMC,SAAS,GAAGJ,SAAS,
|
|
1
|
+
{"version":3,"file":"parse-wmts-capabilities.js","names":["XMLLoader","parseWMTSCapabilities","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wmts/parse-wmts-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n\n/** All capabilities of a WMTS service - response to a WMTS `GetCapabilities` data structure extracted from XML */\nexport type WMTSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: WMTSLayer[];\n };\n};\n\n/** A layer in WMTS */\nexport type WMTSLayer = {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: WMTSTileMatrixSet[];\n};\n\n/** A zoom level in WMTS */\nexport type WMTSTileMatrixSet = {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n };\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\n// export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n// const parsedXML = XMLLoader.parseTextSync(text, options);\n// const xmlCapabilities: any =\n// parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n// return extractCapabilities(xmlCapabilities);\n// }\n\n/** Extract typed capability data from XML */\n// function extractCapabilities(xml: any): WMTSCapabilities {\n// const capabilities: WMTSCapabilities = {\n// name: xml.Service?.Name || 'unnamed',\n// title: xml.Service?.Title,\n// keywords: [],\n// requests: {},\n// layer: extractLayer(xml.Capability?.Layer),\n// raw: xml\n// };\n\n// for (const keyword of xml.Service?.KeywordList?.Keyword || []) {\n// capabilities.keywords.push(keyword);\n// }\n\n// for (const [name, xmlRequest] of Object.entries(xml.Capability?.Request || {})) {\n// capabilities.requests[name] = extractRequest(name, xmlRequest);\n// }\n\n// return capabilities;\n// }\n\n// /** Extract typed request data from XML */\n// function extractRequest(name: string, xmlRequest: any): WMSRequest {\n// const format: string | string[] = xmlRequest?.Format;\n// const mimeTypes: string[] = Array.isArray(format) ? format : [format];\n// return {name, mimeTypes};\n// }\n\n// /** Extract request data */\n// function extractLayer(xmlLayer: any): WMSLayer {\n// const layer: WMSLayer = {\n// name: xmlLayer?.Name,\n// title: xmlLayer?.Title,\n// srs: xmlLayer?.SRS || [],\n// layers: []\n// };\n\n// // Single layer is not represented as array in XML\n// const xmlLayers = getXMLArray(xmlLayer?.Layer);\n\n// for (const xmlSubLayer of xmlLayers) {\n// layer.layers?.push(extractLayer(xmlSubLayer));\n// }\n\n// return layer;\n// }\n\n// function getXMLArray(xmlValue: any) {\n// if (Array.isArray(xmlValue)) {\n// return xmlValue;\n// }\n// if (xmlValue) {\n// return [xmlValue];\n// }\n// return [];\n// }\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAyFzC,OAAO,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAAA,IAAAC,qBAAA;EAC7E,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEK,GAAG,EAAE;MAClE,IAAGL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGN,SAAS,CAACO,YAAY,IAAIP,SAAS;EAChE,OAAOM,eAAe;AACxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWCSCapabilities } from './lib/wcs/parse-wcs-capabilities';
|
|
2
|
-
const VERSION = typeof "
|
|
2
|
+
const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
|
|
3
3
|
export const WCSCapabilitiesLoader = {
|
|
4
4
|
id: 'wcs-capabilities',
|
|
5
5
|
name: 'WFS Capabilities',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wcs-capabilities-loader.js","names":["parseWCSCapabilities","VERSION","WCSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wcs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\nimport {parseWCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {WCSCapabilities};\n\nexport type WCSLoaderOptions = LoaderOptions & {\n wcs?: {};\n};\n\n/**\n * Loader for the response to the WCS GetCapability request\n */\nexport const WCSCapabilitiesLoader = {\n id: 'wcs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wcs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WCSLoaderOptions) =>\n parseWCSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WCSLoaderOptions) => parseWCSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WCSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAW3E,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,
|
|
1
|
+
{"version":3,"file":"wcs-capabilities-loader.js","names":["parseWCSCapabilities","VERSION","WCSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wcs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\nimport {parseWCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {WCSCapabilities};\n\nexport type WCSLoaderOptions = LoaderOptions & {\n wcs?: {};\n};\n\n/**\n * Loader for the response to the WCS GetCapability request\n */\nexport const WCSCapabilitiesLoader = {\n id: 'wcs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wcs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WCSLoaderOptions) =>\n parseWCSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WCSLoaderOptions) => parseWCSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WCSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAW3E,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWFSCapabilities } from './lib/wfs/parse-wfs-capabilities';
|
|
2
|
-
const VERSION = typeof "
|
|
2
|
+
const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
|
|
3
3
|
export const WFSCapabilitiesLoader = {
|
|
4
4
|
id: 'wfs-capabilities',
|
|
5
5
|
name: 'WFS Capabilities',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wfs-capabilities-loader.js","names":["parseWFSCapabilities","VERSION","WFSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wfs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WFSCapabilities} from './lib/wfs/parse-wfs-capabilities';\nimport {parseWFSCapabilities} from './lib/wfs/parse-wfs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type {WFSCapabilities};\n\nexport type WFSLoaderOptions = LoaderOptions & {\n wfs?: {};\n};\n\n/**\n * Loader for the response to the WFS GetCapability request\n */\nexport const WFSCapabilitiesLoader = {\n id: 'wfs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wfs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WFSLoaderOptions) =>\n parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WFSLoaderOptions) => parseWFSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WFSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAW3E,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,
|
|
1
|
+
{"version":3,"file":"wfs-capabilities-loader.js","names":["parseWFSCapabilities","VERSION","WFSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wfs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WFSCapabilities} from './lib/wfs/parse-wfs-capabilities';\nimport {parseWFSCapabilities} from './lib/wfs/parse-wfs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type {WFSCapabilities};\n\nexport type WFSLoaderOptions = LoaderOptions & {\n wfs?: {};\n};\n\n/**\n * Loader for the response to the WFS GetCapability request\n */\nexport const WFSCapabilitiesLoader = {\n id: 'wfs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wfs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WFSLoaderOptions) =>\n parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WFSLoaderOptions) => parseWFSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WFSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAW3E,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-feature-info-loader.js","names":["WMSCapabilitiesLoader","parseWMSFeatureInfo","WMSFeatureInfoLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-feature-info-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {WMSCapabilitiesLoader, WMSLoaderOptions} from '../wms-capabilities-loader';\n\nimport type {WMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\nimport {parseWMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\n\nexport {WMSFeatureInfo};\n\n/**\n * Loader for the response to the WMS GetFeatureInfo request\n */\nexport const WMSFeatureInfoLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-feature-info',\n name: 'WMS FeatureInfo',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":"AAGA,SAAQA,qBAAqB,QAAyB,4BAA4B;AAGlF,SAAQC,mBAAmB,QAAO,uCAAuC;AAOzE,OAAO,MAAMC,oBAAoB,GAAG;EAClC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,iBAAiB;EAEvBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,mBAAmB,CAAC,IAAIO,WAAW,
|
|
1
|
+
{"version":3,"file":"wms-feature-info-loader.js","names":["WMSCapabilitiesLoader","parseWMSFeatureInfo","WMSFeatureInfoLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-feature-info-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {WMSCapabilitiesLoader, WMSLoaderOptions} from '../wms-capabilities-loader';\n\nimport type {WMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\nimport {parseWMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\n\nexport {WMSFeatureInfo};\n\n/**\n * Loader for the response to the WMS GetFeatureInfo request\n */\nexport const WMSFeatureInfoLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-feature-info',\n name: 'WMS FeatureInfo',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":"AAGA,SAAQA,qBAAqB,QAAyB,4BAA4B;AAGlF,SAAQC,mBAAmB,QAAO,uCAAuC;AAOzE,OAAO,MAAMC,oBAAoB,GAAG;EAClC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,iBAAiB;EAEvBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,mBAAmB,CAAC,IAAIO,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EACrEG,aAAa,EAAEA,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,mBAAmB,CAACU,IAAI,EAAEJ,OAAO;AAChG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-layer-description-loader.js","names":["WMSCapabilitiesLoader","parseWMSLayerDescription","WMSLayerDescriptionLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-layer-description-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type{WMSLoaderOptions} from '../wms-capabilities-loader';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\nimport {parseWMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\n\nexport {WMSLayerDescription};\n\n/**\n * Loader for the response to the WMS DescribeLayer request\n */\nexport const WMSLayerDescriptionLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-layer-description',\n name: 'WMS DescribeLayer',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions) =>\n parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSLayerDescription(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSLayerDescriptionLoader;\n"],"mappings":"AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,wBAAwB,QAAO,gDAAgD;AAOvF,OAAO,MAAMC,yBAAyB,GAAG;EACvC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,uBAAuB;EAC3BC,IAAI,EAAE,mBAAmB;EAEzBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,wBAAwB,CAAC,IAAIO,WAAW,
|
|
1
|
+
{"version":3,"file":"wms-layer-description-loader.js","names":["WMSCapabilitiesLoader","parseWMSLayerDescription","WMSLayerDescriptionLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-layer-description-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type{WMSLoaderOptions} from '../wms-capabilities-loader';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\nimport {parseWMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\n\nexport {WMSLayerDescription};\n\n/**\n * Loader for the response to the WMS DescribeLayer request\n */\nexport const WMSLayerDescriptionLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-layer-description',\n name: 'WMS DescribeLayer',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions) =>\n parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSLayerDescription(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSLayerDescriptionLoader;\n"],"mappings":"AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,wBAAwB,QAAO,gDAAgD;AAOvF,OAAO,MAAMC,yBAAyB,GAAG;EACvC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,uBAAuB;EAC3BC,IAAI,EAAE,mBAAmB;EAEzBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,wBAAwB,CAAC,IAAIO,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EAC1EG,aAAa,EAAEA,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,wBAAwB,CAACU,IAAI,EAAEJ,OAAO;AACrG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,yBAAyB"}
|