@sswroom/sswr 1.4.0 → 1.4.1
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/Changelog +3 -0
- package/map.d.ts +1 -1
- package/map.js +3 -3
- package/package.json +1 -1
package/Changelog
CHANGED
package/map.d.ts
CHANGED
|
@@ -189,5 +189,5 @@ export class WMS
|
|
|
189
189
|
version: string;
|
|
190
190
|
|
|
191
191
|
constructor(url: string, layer: string, version?: string);
|
|
192
|
-
queryInfos(mapPos: math.Coord2D, bounds: math.RectArea, width: number, height: number): Promise<
|
|
192
|
+
queryInfos(mapPos: math.Coord2D, bounds: math.RectArea, width: number, height: number): Promise<OWSFeatureCollection | null>;
|
|
193
193
|
}
|
package/map.js
CHANGED
|
@@ -167,9 +167,10 @@ export class WMS
|
|
|
167
167
|
var parser = new DOMParser();
|
|
168
168
|
var contentType = resp.headers.get("Content-Type") || "text/xml";
|
|
169
169
|
var doc = parser.parseFromString(await resp.text(), contentType);
|
|
170
|
-
|
|
170
|
+
var node = doc.childNodes[0];
|
|
171
|
+
if (node.nodeName == "WMS_Capabilities" || node.nodeName == "WMT_MS_Capabilities")
|
|
171
172
|
{
|
|
172
|
-
var attr =
|
|
173
|
+
var attr = node.attributes.getNamedItem("version");
|
|
173
174
|
if (attr)
|
|
174
175
|
{
|
|
175
176
|
this.version = attr.value;
|
|
@@ -203,7 +204,6 @@ export class WMS
|
|
|
203
204
|
console.log("WMS: Unsupported version", this.version);
|
|
204
205
|
return null;
|
|
205
206
|
}
|
|
206
|
-
console.log(url);
|
|
207
207
|
var resp = await fetch(url);
|
|
208
208
|
if (resp.ok)
|
|
209
209
|
{
|