@vertigis/arcgis-extensions 48.4.1 → 48.5.0
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/docs/html/classes/tasks_identify_WMSSublayerIdentifyProvider.WMSSublayerIdentifyProvider.html +2 -2
- package/docs/html/variables/version.version.html +1 -1
- package/package.json +1 -1
- package/tasks/identify/WMSLayerFeatureInfoIdentifyProvider.js +1 -1
- package/tasks/identify/WMSSublayerIdentifyProvider.d.ts +3 -2
- package/tasks/identify/WMSSublayerIdentifyProvider.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/tasks_identify_IdentifyOptions.IdentifyOptions-1.html" class="tsd-signature-type tsd-kind-interface">IdentifyOptions</a></span><div class="tsd-comment tsd-typography"><p>The identify options object.</p>
|
|
15
15
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Geometry</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html">IdentifyProviderBase</a>.<a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html#_applyTolerance">_applyTolerance</a></p></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="_count" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_count</span><a href="#_count" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="_count._count-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_count</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span>, <span class="tsd-kind-parameter">geometry</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/tasks_CountResult.CountResult.html" class="tsd-signature-type tsd-kind-interface">CountResult</a><span class="tsd-signature-symbol">></span><a href="#_count._count-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Invoked to perform the actual work for <a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html#count" class="tsd-kind-method">count</a>. Derived classes
|
|
16
16
|
should override this method rather than count().</p>
|
|
17
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">source</span>: <a href="
|
|
17
|
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">source</span>: <a href="mapping_WMSSublayerExtension.WMSSublayerExtension.html" class="tsd-signature-type tsd-kind-class">WMSSublayerExtension</a></span><div class="tsd-comment tsd-typography"><p>The source to identify.</p>
|
|
18
18
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">geometry</span>: <span class="tsd-signature-type">Geometry</span></span><div class="tsd-comment tsd-typography"><p>The geometry to match against.</p>
|
|
19
19
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/tasks_identify_IdentifyOptions.IdentifyOptions-1.html" class="tsd-signature-type tsd-kind-interface">IdentifyOptions</a><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Options that affect the identify operation.</p>
|
|
20
20
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/tasks_CountResult.CountResult.html" class="tsd-signature-type tsd-kind-interface">CountResult</a><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides <a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html">IdentifyProviderBase</a>.<a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html#_count">_count</a></p></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="_identify" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>_identify</span><a href="#_identify" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="_identify._identify-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_identify</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span>, <span class="tsd-kind-parameter">geometry</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AsyncIterable</span><span class="tsd-signature-symbol"><</span><a href="data_Feature.Feature.html" class="tsd-signature-type tsd-kind-class">Feature</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#_identify._identify-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Invoked to perform the actual work for <a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html#identify" class="tsd-kind-method">identify</a> on a single
|
|
21
21
|
source. Derived classes should override this method rather than
|
|
22
22
|
identify().</p>
|
|
23
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">source</span>: <a href="
|
|
23
|
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">source</span>: <a href="mapping_WMSSublayerExtension.WMSSublayerExtension.html" class="tsd-signature-type tsd-kind-class">WMSSublayerExtension</a></span><div class="tsd-comment tsd-typography"><p>The source to identify.</p>
|
|
24
24
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">geometry</span>: <span class="tsd-signature-type">Geometry</span></span><div class="tsd-comment tsd-typography"><p>The geometry to match against.</p>
|
|
25
25
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</span>: <a href="../interfaces/tasks_identify_IdentifyOptions.IdentifyOptions-1.html" class="tsd-signature-type tsd-kind-interface">IdentifyOptions</a></span><div class="tsd-comment tsd-typography"><p>Options that affect the identify operation.</p>
|
|
26
26
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">AsyncIterable</span><span class="tsd-signature-symbol"><</span><a href="data_Feature.Feature.html" class="tsd-signature-type tsd-kind-class">Feature</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides <a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html">IdentifyProviderBase</a>.<a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html#_identify">_identify</a></p></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_identifyMany" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Protected</code><span>_identify<wbr/>Many</span><a href="#_identifyMany" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="_identifyMany._identifyMany-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">_identify<wbr/>Many</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">sources</span>, <span class="tsd-kind-parameter">geometry</span>, <span class="tsd-kind-parameter">options</span>, <span class="tsd-kind-parameter">geometryType</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AsyncIterable</span><span class="tsd-signature-symbol"><</span><a href="data_Feature.Feature.html" class="tsd-signature-type tsd-kind-class">Feature</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#_identifyMany._identifyMany-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Invoked to perform the work for <a href="tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html#identify" class="tsd-kind-method">identify</a>. Default implementation
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>version | @vertigis/arcgis-extensions</title><meta name="description" content="Documentation for @vertigis/arcgis-extensions"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vertigis/arcgis-extensions</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@vertigis/arcgis-extensions</a></li><li><a href="../modules/version.html">version</a></li><li><a href="version.version.html">version</a></li></ul><h1>Variable version<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">version</span><span class="tsd-signature-symbol"> = "48.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>version | @vertigis/arcgis-extensions</title><meta name="description" content="Documentation for @vertigis/arcgis-extensions"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vertigis/arcgis-extensions</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@vertigis/arcgis-extensions</a></li><li><a href="../modules/version.html">version</a></li><li><a href="version.version.html">version</a></li></ul><h1>Variable version<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">version</span><span class="tsd-signature-symbol"> = "48.5.0"</span></div><div class="tsd-comment tsd-typography"><p>The current version of the Geocortex ArcGIS Extensions API.</p>
|
|
2
2
|
</div><div class="tsd-comment tsd-typography"></div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@vertigis/arcgis-extensions</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@arcgis/core/layers/support/Field.js";import t from"@arcgis/core/popup/FieldInfo.js";import o from"@arcgis/core/request";import{Feature as r}from"../../data/Feature.js";import{wfsFeatureCollectionToFeatures as s}from"../../mapping/support/ogc.js";import{geoJSONToEsri as i}from"../../utilities/_geoJson.js";import{take as a,toArray as n}from"../../utilities/asyncIterable.js";import{isWMSLayerExtension as l}from"../../utilities/extensions.js";import{IdentifyProviderBase as m}from"./IdentifyProviderBase.js";import{isIdentifiable as u}from"./IdentifyService.js";const f=["application/json","application/geojson","text/xml"],c=["OBJECTID","GLOBALID"];export class WMSLayerFeatureInfoIdentifyProvider extends m{isSupported(e,t,o){return l(e)&&e.layer?.featureInfoFormats?.some((e=>f.includes(e)))&&"point"===t?.type}_identify(e,t,r,s){const i=this,n=e._layerView,{extent:l}=n.view,m="point"===t.type?t:t.extent.center,c=n.view.toScreen(m),p=e.layer.featureInfoFormats.find((e=>f.includes(e))),{xmin:y,ymin:d,xmax:g,ymax:F,spatialReference:x}=l,I=`${y},${d},${g},${F}`,h=`EPSG:${x.latestWkid??x.wkid}`,
|
|
1
|
+
import e from"@arcgis/core/layers/support/Field.js";import t from"@arcgis/core/popup/FieldInfo.js";import o from"@arcgis/core/request";import{Feature as r}from"../../data/Feature.js";import{wfsFeatureCollectionToFeatures as s}from"../../mapping/support/ogc.js";import{geoJSONToEsri as i}from"../../utilities/_geoJson.js";import{take as a,toArray as n}from"../../utilities/asyncIterable.js";import{isWMSLayerExtension as l}from"../../utilities/extensions.js";import{IdentifyProviderBase as m}from"./IdentifyProviderBase.js";import{isIdentifiable as u}from"./IdentifyService.js";const f=["application/json","application/geojson","text/xml"],c=["OBJECTID","GLOBALID"];export class WMSLayerFeatureInfoIdentifyProvider extends m{isSupported(e,t,o){return l(e)&&e.layer?.featureInfoFormats?.some((e=>f.includes(e)))&&!e.wfsUrl&&"point"===t?.type}_identify(e,t,r,s){const i=this,n=e._layerView,{extent:l}=n.view,m="point"===t.type?t:t.extent.center,c=n.view.toScreen(m),p=e.layer.featureInfoFormats.find((e=>f.includes(e))),{xmin:y,ymin:d,xmax:g,ymax:F,spatialReference:x}=l,I=`${y},${d},${g},${F}`,h=`EPSG:${x.latestWkid??x.wkid}`,w=e.sublayerExtensions.filter(u).map((({sublayer:e})=>e.name)).filter(Boolean).join();return async function*(){const t=await o(e.layer.featureInfoUrl,{query:{SERVICE:"WMS",LAYERS:w,QUERY_LAYERS:w,REQUEST:"GetFeatureInfo",FORMAT:e.layer.imageFormat,INFO_FORMAT:p,FEATURE_COUNT:r.maxResults,BBOX:I,CRS:h,WIDTH:n.view.width.toString(),HEIGHT:n.view.height.toString(),I:Math.round(c.x).toString(),J:Math.round(c.y).toString(),version:e.layer.version},responseType:"text/xml"===p?"xml":"json"});let s;switch(p){case"application/json":case"application/geojson":s=i._jsonToFeatures(t,r,x,e);break;case"text/xml":s=i._xmlToFeatures(t,e,r)}r.maxResults?yield*a(s,r.maxResults):yield*s}()}async _count(e,t,o){return{source:e,count:(await n(this.identify(e,t,o))).length}}_normalizeFeature(o,r){const s=[];for(const e of o.attributes.keys())s.push(e);!r.returnGeometry&&o.geometry&&(o.geometry=void 0);const{featureSettings:i}=o.source,{popupTemplate:a}=i;if(a&&i._isDefaultPopupTemplate){if(!o.title){const e=c.find((e=>o.attributes.has(e)))??"ID";a.title=`{${e}}`,o.attributes.has(e)||o.attributes.set(e,o.id)}for(const e of s)a.fieldInfos.some((t=>t.fieldName===e))||a.fieldInfos.push(new t({fieldName:e}))}const{source:n}=o;for(const t of s)n.schema.findFieldByName(t)||n.schema.fields.add(new e({name:t,alias:t}));return o}async*_xmlToFeatures(e,t,o){const r=e.data.childNodes[0];if("FeatureCollection"===r.localName)for(const e of await s(r,t))yield this._normalizeFeature(e,o);else yield*this._membersToFeature(r,t,o)}async*_jsonToFeatures(e,t,o,s){const a=e.data,n=new Map;for(const e of a.features){let a;const l=e.properties;t.returnGeometry&&e.geometry&&(a=i(e.geometry),a&&(a.spatialReference=o));let m=n.get(e.layerName);m||(m=s.sublayerExtensions.find((t=>t.sublayer.name===e.layerName))??s,n.set(e.layerName,m)),yield this._normalizeFeature(new r({attributes:l,geometry:a,source:m,id:e.id}),t)}}*_membersToFeature(e,t,o){for(const s of e.getElementsByTagName("FIELDS")){const e=new Map;for(const t of s.getAttributeNames())e.set(t,s.getAttribute(t));yield this._normalizeFeature(new r({attributes:e,source:t}),o)}}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type Geometry from "@arcgis/core/geometry/Geometry";
|
|
2
2
|
import type { Feature } from "../../data/Feature.js";
|
|
3
3
|
import type { FeatureSource } from "../../data/FeatureSource.js";
|
|
4
|
+
import type { WMSSublayerExtension } from "../../mapping/WMSSublayerExtension.js";
|
|
4
5
|
import type { RequestHelper } from "../../utilities/RequestHelper.js";
|
|
5
6
|
import type { CountResult } from "../CountResult.js";
|
|
6
7
|
import type { IdentifyOptions } from "./IdentifyOptions.js";
|
|
@@ -20,11 +21,11 @@ export declare class WMSSublayerIdentifyProvider extends IdentifyProviderBase {
|
|
|
20
21
|
/**
|
|
21
22
|
* @inheritDoc
|
|
22
23
|
*/
|
|
23
|
-
_identify(source:
|
|
24
|
+
_identify(source: WMSSublayerExtension, geometry: Geometry, options?: IdentifyOptions): AsyncIterable<Feature>;
|
|
24
25
|
/**
|
|
25
26
|
* @inheritDoc
|
|
26
27
|
*/
|
|
27
|
-
_count(source:
|
|
28
|
+
_count(source: WMSSublayerExtension, geometry: Geometry, options?: IdentifyOptions): Promise<CountResult>;
|
|
28
29
|
private _createGetFeatureSpatialQuery;
|
|
29
30
|
private _createGetFeatureElement;
|
|
30
31
|
private _createQueryElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@arcgis/core/geometry/SpatialReference";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{wfsFeatureCollectionToFeatures as r}from"../../mapping/support/ogc.js";import{DefaultRequestHelper as
|
|
1
|
+
import e from"@arcgis/core/geometry/SpatialReference";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{wfsFeatureCollectionToFeatures as r}from"../../mapping/support/ogc.js";import{DefaultRequestHelper as i}from"../../utilities/RequestHelper.js";import{OgcNamespace as s,inferGmlVersion as a}from"../../utilities/_ogc.js";import{checkArg as n}from"../../utilities/checkArg.js";import{isWMSSublayerExtension as o}from"../../utilities/extensions.js";import{esriToGml as l,project as c,esriWktToWkid as m}from"../../utilities/geometry.js";import{IdentifyProviderBase as u}from"./IdentifyProviderBase.js";const p="2.0.0";export class WMSSublayerIdentifyProvider extends u{requestHelper=new i;isSupported(e,t,r){return o(e)&&void 0!==e.layerExtension?.wfsUrl}_identify(e,t,i){const s=(async()=>{if(await e.initialize(),await e.initializeWfs(),!e.wfsLayerInfo)return;const r=await this._createGetFeatureSpatialQuery(e,t,i),s={method:"post",body:(new XMLSerializer).serializeToString(r),headers:{"Content-Type":"text/xml; charset=utf-8"}};return this.requestHelper.request(e.layerExtension.wfsUrl,s)})();return async function*(){const t=await s;if(t){const i=await t.text(),s=(new DOMParser).parseFromString(i,"text/xml");if(!t||!s||s.childNodes.length<1)throw new Error("Response to WFS GetFeature request was invalid.");yield*await r(s.childNodes[0],e)}}()}async _count(e,t,i={}){const s=(async()=>{if(await e.initialize(),await e.initializeWfs(),!e.wfsLayerInfo)return;const r=await this._createGetFeatureSpatialQuery(e,t,i),s={method:"post",body:(new XMLSerializer).serializeToString(r),headers:{"Content-Type":"text/xml; charset=utf-8"}};return this.requestHelper.request(e.layerExtension.wfsUrl,s)})();let a;const n=await s;if(n){const t=await n.text(),i=(new DOMParser).parseFromString(t,"text/xml");if(!n||!i||i.childNodes.length<1)throw new Error("Response to WFS GetFeature request was invalid.");a=await r(i.childNodes[0],e)}return{source:e,count:a?.length??0}}async _createGetFeatureSpatialQuery(e,t,r){n("sublayerX",e).isNotMissing(),n("geometry",t).isNotMissing().satisfies((e=>["extent","point","polygon","polyline"].includes(e.type)));const{wfsLayerInfo:i}=e,s=i.wfsCapabilities.featureTypes.find((e=>e.namespaceUri===i.namespaceUri&&e.name===i.name)),a=this._createGetFeatureElement(r),o=await this._createQueryElement(s,t);a.appendChild(o);let l=i.fields.map((e=>e.name)).filter((e=>"__esri_wfs_id__"!==e));const c=r.outFields??e.featureSettings.outFields;c&&c.length>0&&(c.includes("*")||(l=c));const{geometryField:m}=e.wfsLayerInfo;l.includes(m)||(l=l.concat(m));for(const e of l){const t=this._createElement("wfs","PropertyName");t.textContent=e,o.appendChild(t)}const u=this._createElement("fes","Filter");o.appendChild(u);const p=this._createElement("fes","Intersects");u.appendChild(p);const f=this._createGeometryFieldElement(e);p.appendChild(f);const d=await this._createGeometryElement(e,t);return p.appendChild(d),a}_createGetFeatureElement(e){const t=this._createElement("wfs","GetFeature");t.setAttribute("service","WFS"),t.setAttribute("version",p),t.setAttribute("xmlns:xs",s.XS),t.setAttribute("xmlns:ogc",s.OGC),t.setAttribute("xmlns:wfs",this._getWfsNameSpace(p)),t.setAttribute("xmlns:gml",this._getGmlNameSpace(p)),t.setAttribute("outputFormat","application/gml+xml; version=3.2");let r=1e3;return e?.maxResults&&(r=e.maxResults),t.setAttribute("count",r.toString()),t.setAttribute("xmlns:fes",s.FES_2_0),t}async _createQueryElement(e,t){const r=this._createElement("wfs","Query"),i=await this._getCompatibleSR(e,t),s=this._getSrsName(i);return r.setAttribute("typeNames",e.name),r.setAttribute("srsName",s),r}_createGeometryFieldElement(e){const{geometryField:r}=e.wfsLayerInfo;if(!r)throw new t("The WFS feature type does not have a geometry field");const i=this._createElement("fes","ValueReference");return i.textContent=r,i}async _createGeometryElement(e,t){n("geometry",t).isNotMissing(),n("geometry.spatialReference",t.spatialReference).isNotMissing();const r={gmlVersion:a(p)},i=await this._getCompatibleSR(e.wfsFeatureType,t);if(r.srsName=this._getSrsName(i),i.equals(t.spatialReference))return l(t,r);{const i=await this.projectGeometry(t,e.wfsFeatureType.defaultSpatialReference);return l(i,r)}}async projectGeometry(t,r){const i=await c([t],new e({wkid:r}));if(i&&i.length>0)return i[0];throw new Error("Unable to create a geometry element.")}_createElement(e,t){n("name",t).isNotMissing();const r=document.implementation.createDocument(void 0,"temp",void 0);return e?r.createElement(`${e}:${t}`):r.createElement(t)}_getWfsNameSpace(e){switch(e){case"1.0.0":case"1.1.0":return s.WFS;default:return s.WFS_2_0}}_getGmlNameSpace(e){switch(e){case"1.0.0":case"1.1.0":return s.GML;default:return s.GML_3_2}}async _getCompatibleSR(t,r){n("wfsFeatureType",t).isNotMissing(),n("geometry",r).isNotMissing();const i=r.spatialReference.wkid?r.spatialReference:new e({wkid:await m(r.spatialReference.wkt)});return t.supportedSpatialReferences.map((t=>new e({wkid:t}))).find((e=>e.equals(i)))??new e({wkid:t.defaultSpatialReference})}_getSrsName(e){return`EPSG:${e.wkid}`}}
|
package/version.d.ts
CHANGED
package/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version="48.
|
|
1
|
+
export const version="48.5.0";
|