@vertigis/arcgis-extensions 48.0.0 → 48.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +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>mapping/_LayerExtensionCollectionImpl | @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="mapping__LayerExtensionCollectionImpl.html">mapping/_LayerExtensionCollectionImpl</a></li></ul><h1>Module mapping/_LayerExtensionCollectionImpl</h1></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Classes</h3><div class="tsd-index-list"><a href="../classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-128"></use></svg><span>Layer<wbr/>Extension<wbr/>Collection<wbr/>Impl</span></a>
2
+ </div></section></section></section></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>
@@ -100,6 +100,7 @@
100
100
  <a href="modules/layer_preset_LayerPresetSettings.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>layer-<wbr/>preset/<wbr/>Layer<wbr/>Preset<wbr/>Settings</span></a>
101
101
  <a href="modules/locale.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>locale</span></a>
102
102
  <a href="modules/mapping__LayerExtension.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>mapping/_<wbr/>Layer<wbr/>Extension</span></a>
103
+ <a href="modules/mapping__LayerExtensionCollectionImpl.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>mapping/_<wbr/>Layer<wbr/>Extension<wbr/>Collection<wbr/>Impl</span></a>
103
104
  <a href="modules/mapping__SublayerExtension.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>mapping/_<wbr/>Sublayer<wbr/>Extension</span></a>
104
105
  <a href="modules/mapping_ArcGISSublayerExtension.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>mapping/<wbr/>ArcGISSublayer<wbr/>Extension</span></a>
105
106
  <a href="modules/mapping_BasemapExtension.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2"></use></svg><span>mapping/<wbr/>Basemap<wbr/>Extension</span></a>
@@ -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"> = &quot;48.0.0&quot;</span></div><div class="tsd-comment tsd-typography"><p>The current version of the Geocortex ArcGIS Extensions API.</p>
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"> = &quot;48.0.2&quot;</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>
@@ -31,9 +31,8 @@ import type { GroundExtensionProperties } from "./GroundExtension.js";
31
31
  import { GroundExtension } from "./GroundExtension.js";
32
32
  import type { MapConstraintsProperties } from "./MapConstraints.js";
33
33
  import { MapConstraints } from "./MapConstraints.js";
34
- import { type LayerExtensionProperties, LayerExtension } from "./_LayerExtension.js";
35
- import type { LayerExtensionCollection } from "./support/_LayerExtensionCollection.js";
36
- import { LayerExtensionCollectionBase } from "./support/_LayerExtensionCollection.js";
34
+ import type { LayerExtensionProperties, LayerExtension } from "./_LayerExtension.js";
35
+ import type { LayerExtensionCollection, LayerExtensionCollectionBase } from "./support/_LayerExtensionCollection.js";
37
36
  /**
38
37
  * A web map definition or reference.
39
38
  */
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import{ArgumentError as i}from"../ArgumentError.js";import{EntityBase as s}from"../Entity.js";import{InvalidOperationError as a}from"../InvalidOperationError.js";import{isBasemapExtension as n,isBookmark as r,isGroundExtension as o,isLayerExtension as p,isLayerPreset as h,isMenu as m,isTableExtension as l,ItemType as d}from"../ItemType.js";import{TableExtension as c}from"../data/TableExtension.js";import{layerToParentJsonCache as b}from"../json/LayerJson.js";import{applyJsonToWebMap as _}from"../json/WebMapJson.js";import{applyJsonToWebScene as E}from"../json/WebSceneJson.js";import{LayerPreset as u}from"../layer-preset/LayerPreset.js";import{Menu as w}from"../menus/Menu.js";import{DefaultArcGISRequestHelper as x}from"../support/ArcGISRequestHelper.js";import{FormatSettings as f}from"../support/FormatSettings.js";import{InitializableCollectionProxy as y}from"../support/InitializableCollectionProxy.js";import{ReadOnlyInitializableCollection as M}from"../support/ReadOnlyInitializableCollection.js";import{serializable as g}from"../support/Serializable.js";import{WellKnownBasemap as I}from"../support/esri.js";import{ReadOnlyCollection as v}from"../utilities/ReadOnlyCollection.js";import{basemapsAreEquivalent as S,createStandardBasemap as z,getStandardBasemapId as O,isStandardBasemap as A}from"../utilities/basemaps.js";import{checkArg as P}from"../utilities/checkArg.js";import{compare as T}from"../utilities/collection.js";import{load as C}from"../utilities/esri.js";import{isGroupLayerExtension as V}from"../utilities/extensions.js";import{filter as k}from"../utilities/iterable.js";import{isWMTSLayer as L,layersAreEquivalent as j}from"../utilities/layers.js";import{getLogger as B}from"../utilities/log.js";import{getMapSpatialReference as N,isMap as R,isWebMap as W,isWebScene as H}from"../utilities/mapping.js";import{toPortalItem as J}from"../utilities/portal.js";import{parallelEach as F}from"../utilities/promise.js";import{onCollectionPropertyChange as q,onEach as G}from"../utilities/watch.js";import{BasemapExtension as D}from"./BasemapExtension.js";import{Bookmark as U}from"./Bookmark.js";import{GroundExtension as $}from"./GroundExtension.js";import{MapConstraints as X}from"./MapConstraints.js";import{UnsupportedLayerExtension as Y}from"./UnsupportedLayerExtension.js";import{LayerExtension as K}from"./_LayerExtension.js";import{_assignLayerExtensions as Q}from"./_LayerExtension.js";import{LayerExtensionCollectionBase as Z}from"./support/_LayerExtensionCollection.js";const ee=B("MapExtension");let te=class extends s{get webMap(){return this._webMap}get webScene(){return this._webScene}get map(){return this._currentMap}get viewMode(){return this.map?H(this.map)?"scene":"map":this.initialViewMode}get initialViewMode(){return this.webMap&&this.webScene?this._initialViewMode||"map":H(this.map)||this.webScene&&!this.webMap?"scene":"map"}set initialViewMode(e){this._initialViewMode=e}get requestHelper(){return this._requestHelper||(this._requestHelper=new x),this._requestHelper}set requestHelper(e){this._requestHelper=e}get basemapExtension(){return this._basemapExtension}set basemapExtension(e){const t=this._basemapExtension;if(t!==e)if(t&&t._setMapExtension(void 0),e){if(e._setMapExtension(this),this.isInitialized&&!e.basemap){if(e.isInitialized)throw e._setMapExtension(void 0),new a("Cannot set MapExtension.basemapExtension without a valid Esri Basemap object");e.initialize()}this._ensureIsBasemapOption(e),this.map&&e.basemap&&e.basemap!==this.map.basemap?this.map.basemap=e.basemap:this._basemapExtension=e}else this.map.basemap=void 0,this._basemapExtension=void 0}get groundExtension(){return this._groundExtension||(this.groundExtension=$.create({ground:this.map?.ground})),this._groundExtension}set groundExtension(e){if(!e)throw new a("Cannot set map.ground to undefined");const t=this._groundExtension;t!==e&&(t&&t._setMapExtension(void 0),e._setMapExtension(this),e._resolveGround(),e.ground?(this._groundExtensions.set(e.ground,e),this.map&&e.ground!==this.map.ground?this.map.ground=e.ground:this._groundExtension=e):this._groundExtension=e)}get basemapOptions(){return this._basemapOptions}get bookmarks(){return this._bookmarks}get initialBasemapExtension(){return this._initialBasemapExtension}get initialLayerPreset(){return this._initialLayerPreset}set initialLayerPreset(e){if(!e)return void(this._initialLayerPreset=void 0);const t=h(e)?e:new u(e);this._initialLayerPreset=t}get _spatialReference(){return N(this.map)}get webMapItemTitle(){if(this._webMapItem)return this._webMapItem.title}get webSceneItemTitle(){if(this._webSceneItem)return this._webSceneItem.title}get title(){return this._title?this._title:this._webMapItem&&"map"===this.viewMode?this.webMapItemTitle:this._webSceneItem&&"scene"===this.viewMode?this.webSceneItemTitle:void 0}set title(e){this._title=e}formatSettings;constraints;onClick;onHover;onHoverEnd;onInitialized;onViewpointChanged;get contextMenu(){return this._contextMenu}set contextMenu(e){this._contextMenu=e,e&&this.isInitialized&&!e.isInitialized&&(async()=>{try{await e.initialize()}catch(e){e instanceof Error&&ee.error({message:"An error occurred while initializing context menu.",error:e})}})()}isSwitchingMap=!1;_layerViews=new t;get _allLayerViews(){const e=i=>{const s=[i];return t.isCollection(i.sublayerViews)?s.push(...i.sublayerViews.toArray().flatMap(e)):t.isCollection(i.layerViews)&&s.push(...i.layerViews.toArray().flatMap(e)),s};return this._layerViews.toArray().flatMap(e)}get layerExtensions(){return this._layerExtensions}tableExtensions;allLayerExtensions;_itemType=d.MAP_EXTENSION;_map;_scene;_deserializedMapPromise;_deserializedViewMode;_deserializedViewModePromise;_deferredProperties;_currentMap;_requestHelper;_basemapExtension;_groundExtension;_basemapOptions;_groundExtensions;_bookmarks;_layerExtensions;_webMap;_webMapItem;_webScene;_webSceneItem;_title;_initialViewMode;_initialLayerPreset;_initialBasemapExtension;_skipBasemapOptions=!1;_createScenePromise;_createMapPromise;_contextMenu;constructor(e){super(e);let s={...e};this._basemapOptions=new se(this),this._groundExtensions=new WeakMap,this._layerExtensions=this._createLayerExtensionCollection(),this.tableExtensions=this._createTableExtensionCollection(),this.formatSettings=this._createFormatSettings(),this._bookmarks=new t,this.constraints=new X,this.watch(["_map","_scene"],(e=>{e&&(G(e.layers,"layerview-create",(e=>{this._layerViews.add(e.layerView)})),G(e.layers,"layerview-destroy",(e=>{this._layerViews.remove(e.layerView)})))}));const{webMap:a,webScene:n,initialViewMode:r,map:o,basemapOptions:p}=s;if(this._webMap=a,this._webScene=n,this._webMapItem=re(a),this._webSceneItem=re(n),this.initialViewMode=r,H(o)&&n)throw new i("Cannot specify webScene property if map is initialized to a WebScene instance.");if(R(o)&&a)throw new i("Cannot specify webMap property if map is initialized to a 2D Map instance.");if(H(o)||W(o)||R(o))this.assignProperties({basemapOptions:p}),this._skipBasemapOptions=!!p;else{const{layerExtensions:e,tableExtensions:t,groundExtension:i,basemapOptions:a,basemapExtension:n,...r}=s;this._deferredProperties={layerExtensions:e,tableExtensions:t,groundExtension:i,basemapOptions:a,basemapExtension:n},s=r,a&&(this._skipBasemapOptions=!0)}this._initMapFromProperties(s),this.watch("map.basemap",(()=>this._onBasemapChange()),!0),this.watch("map.ground",(()=>this._onGroundChange()),!0),this.allLayerExtensions=new ne(this),this.map?.basemap&&this._onBasemapChange()}getLayerExtensionsForView(e=this.viewMode){return(("map"===e?this._map:this._scene)?.layers.toArray()??[]).map((e=>this._layerExtensions._forLayer(e))).filter((e=>e instanceof Y||!e.dynamicallyAddedLayer))}getAllFeatureSources(e=()=>!0){const t=[],i=a=>{a.hasFeatures&&t.push(a);for(const t of a.sublayerExtensions.initializedItems.filter(e).toArray())s(t);if(V(a))for(const t of a.layerExtensions.initializedItems.filter(e).toArray())i(t)},s=i=>{t.push(i);for(const t of i.sublayerExtensions.initializedItems.filter(e).toArray())s(t)};for(const t of this.layerExtensions.initializedItems.filter(e).toArray())i(t);for(const i of this.tableExtensions.initializedItems.filter(e).toArray())t.push(i);if(this.basemapExtension){for(const t of this.basemapExtension.baseLayerExtensions.initializedItems.filter(e).toArray())i(t);for(const t of this.basemapExtension.referenceLayerExtensions.initializedItems.filter(e).toArray())i(t)}return t}isSupportedViewMode(e){return e===this.viewMode||!(!this.webMap&&!this.webScene)&&("scene"===e?!!this.webScene:!!this.webMap)}async switchViewMode(e){if(P("viewMode",e).isNotMissing().satisfies((e=>this.isSupportedViewMode(e)),"Unsupported view mode."),this.viewMode===e)return;let t;"scene"===e?(await this._createScene(),t=this._scene):(await this._createMap(),t=this._map),t.basemap=this.map.basemap,await this.switchMap(t),this.notifyChange("viewMode"),this.notifyChange("title")}async switchMap(e){if(P("newMap",e).isNotMissing(),e===this.map)return;if(!this.map)return void this._setMap(e);this.isSwitchingMap=!0,this.isInitialized&&await he(e);const t=new Map(this.map.layers.map((e=>[e,this.layerExtensions.forLayer(e)]))),i=new Map(this.map.tables.map((e=>[e,this.tableExtensions.forTable(e)]))),{basemapExtension:s}=this;this._setMap(e),this._updateBookmarks();const a=[];for(const e of this.map.layers.toArray()){const i=[...k(t.entries(),(([t])=>j(t,e)))];if(1===i.length){const[t]=i;a.push((async()=>{const i=t[1];await i._switchLayer(e),this._layerExtensions._register(i)})())}else{const t=this._layerExtensions._forLayer(e);t&&t.layer!==e&&a.push(t._switchLayer(e))}}for(const e of this.map.tables.toArray()){const t=[...k(i.entries(),(([t])=>j(t,e)))];if(1===t.length){const[i]=t;a.push((async()=>{const t=i[1];await t._switchTable(e),this.tableExtensions.add(t)})())}else{const t=this.tableExtensions.forTable(e);t&&t.table!==e&&a.push(t._switchTable(e))}}this.map.basemap&&s&&S(this.map.basemap,s.basemap)&&a.push((async()=>{await s._switchBasemap(this.map.basemap),this.basemapExtension=s})()),await Promise.all(a),this.isInitialized&&await this._initializeChildren(),this.isSwitchingMap=!1}async setWebMap(e){if(!e&&this.webMap&&!this.webScene)throw new a("Cannot unset both webMap and webScene.");this._webMap=e,this._map=void 0,this._createMapPromise=void 0,this._webMapItem=re(e),await C(this._webMapItem),"map"===this.viewMode&&(e?(this._basemapOptions.isExplicitlyModified||this._basemapOptions.removeAllInternal(),await this._createMap(),await this.switchMap(this._map),await this._createStandardBasemapOptions(),this._basemapOptions.reorderInternal(this.basemapExtension,0),this._initialBasemapExtension=this.basemapExtension):await this.switchViewMode("scene")),this.notifyChange("webMap"),this.notifyChange("initialViewMode"),this.notifyChange("title")}async setWebScene(e){if(!e&&this.webScene&&!this.webMap)throw new a("Cannot unset both webMap and webScene.");this._webScene=e,this._scene=void 0,this._createScenePromise=void 0,this._webSceneItem=re(e),await C(this._webSceneItem),"scene"===this.viewMode&&(e?(this._basemapOptions.isExplicitlyModified||this._basemapOptions.removeAllInternal(),await this._createScene(),await this.switchMap(this._scene),await this._createStandardBasemapOptions(),this._basemapOptions.reorderInternal(this.basemapExtension,0),this._initialBasemapExtension=this.basemapExtension):await this.switchViewMode("map")),this.notifyChange("webScene"),this.notifyChange("initialViewMode"),this.notifyChange("title")}getDefaults(){const e=super.getDefaults();return e.initialViewMode="map",e}async _createScene(){if(!this._scene&&this.webScene)return this._createScenePromise=this._createScenePromise??(async()=>{const e=(await import("@arcgis/core/WebScene")).default;oe(this.webScene)?(this._webSceneItem.type="Web Scene",this._scene=new e({portalItem:this._webSceneItem})):this._scene=e.fromJSON(this.webScene)})()}async _createMap(){if(!this._map&&this.webMap)return this._createMapPromise=this._createMapPromise??(async()=>{const e=(await import("@arcgis/core/WebMap")).default;oe(this.webMap)?(this._webMapItem.type="Web Map",this._map=new e({portalItem:this._webMapItem})):this._map=e.fromJSON(this.webMap)})()}_getSerializableProperties(){return{...super._getSerializableProperties(),layerExtensions:{serializeModes:["initial","project"],deserialize:e=>{if(this.map&&e){const t="map"===this.viewMode,i=(t?this._scene:this._map)?.layers.toArray()??[],s=e.filter((e=>!i.includes(e.layer)&&!i.some((t=>e.layer&&j(t,e.layer)))));Q(this.layerExtensions,s)}},serialize:e=>{if(this._deferredProperties?.layerExtensions)return this._deferredProperties.layerExtensions;{const t="map"===this.viewMode,i=(t?this._map:this._scene)?.layers.toArray();let s=(t?this._scene:this._map)?.layers.toArray()??[];return s=s.filter((e=>!i.find((t=>j(t,e))))),this.layerExtensions.concat(s.map((e=>this._layerExtensions._forLayer(e)))).filter((t=>!(t instanceof Y||"initial"===e)||!t.dynamicallyAddedLayer)).toArray()}}},tableExtensions:{serializeModes:["initial","project"],deserialize:e=>{this.map?T(this.tableExtensions,e,{onNew:(e,t)=>{this.tableExtensions.add(l(e)?e:c.create(e),t)},onMatch:(e,t,i,s)=>{l(t)||e.assignProperties(t),i!==s&&this.tableExtensions.reorder(e,s)},equals:(e,t)=>l(t)?t===e:!!c._matchesRef(e,t.table)||e.id===t.id}):this._deferredProperties={...this._deferredProperties,tableExtensions:e}},serialize:()=>this._deferredProperties?.tableExtensions?this._deferredProperties?.tableExtensions:this.tableExtensions.toArray()},basemapExtension:{serializeModes:["project"],deserialize:e=>{if(this.map)if(e)if(n(e))this.basemapExtension=e;else{if(this.basemapExtension)return this.basemapExtension.assignPropertiesAsync(e);this.basemapExtension=D.create(e)}else this.basemapExtension=void 0;else this._deferredProperties={...this._deferredProperties,basemapExtension:e}},serialize:()=>this._deferredProperties?.basemapExtension?this._deferredProperties?.basemapExtension:this.basemapExtension},basemapOptions:{serializeModes:["initial"],deserialize:e=>{this._skipBasemapOptions?this._skipBasemapOptions=!1:(T(this.basemapOptions,e,{onNew:(e,t)=>{this.basemapOptions.add(n(e)?e:D.create(e),t)},onMatch:(e,t,i,s)=>{n(t)||e.assignProperties(t),i!==s&&this.basemapOptions.reorder(e,s)},onMissing:e=>{this.basemapOptions.remove(e)},equals:(e,t)=>{if(n(t))return t===e;if(e.id&&t.id)return e.id===t.id;{const i=e.toJSON();return S(i.basemap,t.basemap||t.baseMap)}}}),this.basemapExtension&&this._ensureIsBasemapOption(this.basemapExtension),this.isInitialized&&F(this.basemapOptions.toArray(),(e=>e._createBackingBasemap())))},serialize:()=>this._deferredProperties?.basemapOptions?this._deferredProperties?.basemapOptions:this.basemapOptions.toArray()},groundExtension:{serializeModes:["initial"],deserialize:e=>{if(this.map){if(!o(e))return this.groundExtension.assignPropertiesAsync(e);this.groundExtension=e}else this._deferredProperties={...this._deferredProperties,groundExtension:e}},serialize:()=>this._deferredProperties?.groundExtension?this._deferredProperties?.groundExtension:this.groundExtension},bookmarks:{serialize:()=>this.bookmarks.map((e=>e.toJSON())).toArray(),deserialize:e=>{this.bookmarks.addMany(e.map((e=>r(e)?e:new U(e))))}},webMap:{serializeModes:["initial"],deserialize:!1},webScene:{serializeModes:["initial"],deserialize:!1},initialLayerPreset:"initial",initialViewMode:{serializeModes:["initial","project"],serialize:e=>"project"===e?this.viewMode:"scene"!==this.initialViewMode||!this.webScene&&this.webMap?"map":"scene",deserialize:e=>{this.viewMode!==e&&(this._deserializedViewMode=e),this._initialViewMode=e},isDefault:(e,t)=>"project"!==t&&"map"===e},formatSettings:"initial",constraints:"initial",title:"initial",onClick:"initial",onHover:"initial",onHoverEnd:"initial",onInitialized:"initial",onViewpointChanged:"initial",contextMenu:{serializeModes:["initial"],deserialize:e=>{e?m(e)?this.contextMenu=e:this.contextMenu?this.contextMenu.assignProperties(e):this.contextMenu=w.create(e):this.contextMenu=void 0}},map:{serializeModes:["project"],serialize:()=>{b.lookup=new WeakMap;const e=this.layerExtensions.toArray().filter((e=>e.layer)).map((e=>e._getProjectWebmapJSON())),t=this.tableExtensions.toArray().filter((e=>e.table)).map((e=>({id:e.table.id,title:e.table.title})));return b.lookup=void 0,e.length>0||t.length>0?{operationalLayers:e,tables:t}:{}},deserialize:e=>{if(!this.map)throw new i("Cannot specify JSON object for the 'map' property. It must be an ArcGIS API Map instance. To specify JSON, use 'webMap' or 'webScene' instead.");if(R(e)||W(e)||H(e)){if(e!==this.map)throw new i("properties.map","Property 'map' is read-only.")}else this._deserializedMapPromise=(async()=>{this._deserializedViewMode&&this.webMap&&this.webScene&&(this._deserializedViewModePromise=this.switchViewMode(this._deserializedViewMode),await this._deserializedViewModePromise,this._deserializedViewMode=void 0,this._deserializedViewModePromise=void 0),await this._applyMapProperties(e,this.map),this._deserializedMapPromise=void 0})()}},requestHelper:{serialize:!1}}}async _applyMapProperties(e,t,i){await F(this.basemapOptions.toArray(),(e=>e._createBackingBasemap()));let s=e;const a=this.basemapOptions.find((e=>S(e.basemap,s.baseMap)));a&&(t.basemap=a.basemap,s={...s,baseMap:{...s.baseMap,title:t.basemap.title}}),H(t)?await E(s,t,i):await _(s,t,i)}_createFormatSettings(){return new f}_createLayerExtensionCollection(){return new ie(this)}_createTableExtensionCollection(){return new ae(this)}async _onInitialize(){await super._onInitialize();const{basemapOptions:e,basemapExtension:t,webMap:i,webScene:s,...a}=this._deferredProperties??{};if(this.map||("scene"===this.initialViewMode?(await this._createScene(),this._setMap(this._scene)):(await this._createMap(),this._setMap(this._map))),this._webMapItem||this._webSceneItem?(await Promise.all([he(this.map),C(this._webMapItem),C(this._webSceneItem)]),pe(this._webMapItem,"webMap","Web Map"),pe(this._webSceneItem,"webScene","Web Scene")):await he(this.map),t&&(!n(t)&&t.basemap?this.basemapExtension=D.create(t):await this.assignPropertiesAsync({basemapExtension:t}),await this.basemapExtension._createBackingBasemap()),e){const t=e.find((e=>n(e)&&S(this.map.basemap,e.toJSON().basemap)));if(t){const e=t.toJSON().basemap?.id??t.basemap?.id,i=t.toJSON().basemap?.title;await t._switchBasemap(this.map.basemap),this.basemapExtension=t,e&&(this.map.basemap.id=e),i&&(this.map.basemap.title=i)}await this.assignPropertiesAsync({basemapOptions:e})}await this.assignPropertiesAsync(a),this._deferredProperties=void 0,this._initialBasemapExtension=this.basemapExtension,this._updateBookmarks();for(const e of this.layerExtensions.toArray())await e._createBackingLayer();await Promise.all(this.tableExtensions.map((e=>e._createBackingTable())).toArray())}async _postInitialize(){await super._postInitialize(),await this._createStandardBasemapOptions(),await F(this.basemapOptions.toArray(),(e=>e._createBackingBasemap())),this.initialLayerPreset&&await this.initialLayerPreset.applyTo(this)}*_initializableChildCollections(){yield*super._initializableChildCollections();const e=new t(this.layerExtensions.filter((e=>!!e.layer)));e.remove=e=>this.layerExtensions.remove(e);const i=new t(this.tableExtensions.filter((e=>!!e.table)));if(i.remove=e=>this.tableExtensions.remove(e),yield e,yield i,this.basemapExtension){const e=new t;e.add(this.basemapExtension),yield e}const s=new t;s.add(this.groundExtension),yield s}_initMapFromProperties(e){const t=e.map;R(t)||W(t)||H(t)?this._setMap(t):"scene"===this.initialViewMode?e.webScene&&!oe(e.webScene)&&(this._deferredProperties={webScene:e.webScene,...this._deferredProperties}):e.webMap&&!oe(e.webMap)&&(this._deferredProperties={webMap:e.webMap,...this._deferredProperties})}_setMap(e){H(e)?this._scene=e:this._map=e,this._currentMap=e,this.basemapExtension?.basemap&&!e.basemap&&(e.basemap=this.basemapExtension.basemap),this.groundExtension?.ground&&!e.ground&&(e.ground=this.groundExtension.ground),this.notifyChange("map")}_onBasemapChange(){if(this._basemapExtension){if(this.basemapExtension.basemap==this.map.basemap)return;this._basemapExtension._setMapExtension(void 0)}if(this.map.basemap){let e=this.basemapOptions.find((e=>this.map.basemap===e.basemap));if(!e){const t=this.basemapOptions.find((e=>S(e.basemap,this.map.basemap)));t?(e=t,e._switchBasemap(this.map.basemap)):(e=D.create({basemap:this.map.basemap}),this._basemapOptions.addInternal(e,0))}e.mapExtension!==this&&e._setMapExtension(this),this._basemapExtension=e}else this._basemapExtension=void 0;this.notifyChange("basemapExtension")}_onGroundChange(){if(this._groundExtension){if(this.map.ground&&this.groundExtension.ground===this.map.ground)return void(this._groundExtensions.has(this.map.ground)||this._groundExtensions.set(this.map.ground,this.groundExtension));this.groundExtension._setMapExtension(void 0)}this.map.ground&&!this._groundExtensions.has(this.map.ground)&&this._groundExtensions.set(this.map.ground,$.create({ground:this.map.ground}));const e=this._groundExtensions.get(this.map.ground);e&&e.mapExtension!==this&&e._setMapExtension(this),this._groundExtension=e,this.notifyChange("groundExtension")}async _createStandardBasemapOptions(){const e=this._spatialReference;!this._basemapOptions.isExplicitlyModified&&e?.isWebMercator&&await F([I.SATELLITE,I.HYBRID_VECTOR,I.STREETS_VECTOR,I.TOPO_VECTOR,I.STREETS_NAVIGATION_VECTOR,I.STREETS_NIGHT_VECTOR,I.TERRAIN_VECTOR,I.DARK_GRAY_VECTOR,I.GRAY_VECTOR,I.OCEANS_VECTOR,I.OPEN_STREET_MAP_VECTOR],(async e=>{const t=await z(e);S(this.map.basemap,t)?this._basemapOptions.addInternal(this.basemapExtension):this._basemapOptions.addInternal(D.create({basemap:t}),void 0,!1)}))}_ensureIsBasemapOption(e){const t=this.basemapOptions.findIndex((t=>t.basemap===e.basemap));t>=0?this._basemapOptions.getItemAt(t)!==e&&(this._basemapOptions.removeAtInternal(t),this._basemapOptions.addInternal(e,t)):this._basemapOptions.addInternal(e,0)}_updateBookmarks(){this.bookmarks.removeMany(this.bookmarks.filter((e=>"map"===e.source))),W(this.map)&&this.map.bookmarks?.length>0?this.map.bookmarks.forEach((e=>{this.bookmarks.add(new U({source:"map",title:e.name,viewpoint:e.viewpoint}))})):H(this.map)&&this.map.presentation?.slides?.length>0&&this.map.presentation.slides.forEach((e=>{const t={source:"map",title:e.title.text,viewpoint:e.viewpoint},i=new U(t);this.bookmarks.add(i)}))}};te=e([g],te);export{te as MapExtension};class ie extends Z{get _mapExtension(){return this._parent}constructor(e){super(e,"map.layers")}toJSON(){const e=[];return this.forEach((t=>{e.push(`item://${encodeURIComponent(d.LAYER_EXTENSION)}/${encodeURIComponent(t.id)}`)})),e}_forLayer(e){const t=this._mapExtension?._deferredProperties?.layerExtensions?.map((e=>p(e)?e:K.create(e)))??[];t?.length&&(this._mapExtension._deferredProperties.layerExtensions=t);for(const e of t)e.layer||e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this._mapExtension&&!e.mapExtension&&e._setMapExtension(this._mapExtension));return super._forLayer(e)}}class se extends y{isExplicitlyModified=!1;_mapExtension;constructor(e){super(new t),this._mapExtension=e}add(e,t){return super.add(e,t),this.isExplicitlyModified=!0,1===this.length&&this._mapExtension.map&&!this._mapExtension.basemapExtension&&(this._mapExtension.basemapExtension=e),this}addMany(e,t){return super.addMany(e,t),this.isExplicitlyModified=!0,this}addInternal(e,t,i=!0){const s=e=>{const t="-vector";return e?.endsWith(t)?e.substring(0,e.length-7):e};let a;if(e.basemap){const t=s(e.basemap.id);if(a=this.findIndex((e=>s(e.basemap?.id)===t)),A(e.basemap)&&a>=0){if(!i)return;super.removeAt(a)}}super.add(e,t??(a>=0?a:void 0))}removeAt(e){const t=super.removeAt(e);return t&&(this.isExplicitlyModified=!0,t===this._mapExtension.basemapExtension&&(e<this.length?this._mapExtension.basemapExtension=this.getItemAt(e):this.length?this._mapExtension.basemapExtension=this.getItemAt(e-1):this._mapExtension.basemapExtension=void 0)),t}removeAll(){return this._mapExtension.basemapExtension=void 0,super.removeAll()}removeAtInternal(e){return super.removeAt(e)}removeAllInternal(){for(;this.length;)this.removeAtInternal(this.length-1)}reorder(e,t){return super.reorder(e,t),this.isExplicitlyModified=!0,e}reorderInternal(e,t){return super.reorder(e,t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.basemap}}class ae extends y{get _collection(){return this._tables.map((e=>this._forTable(e))).concat(Array.from(this._uninitializedTableExtensions))}get _tables(){return this._mapExtension.map?.tables??new v(new t)}_mapExtension;_tableExtensionMap=new WeakMap;_uninitializedTableExtensions=new Set;constructor(e){super(),this._mapExtension=e,q(this._mapExtension,"map.tables",(e=>{const t={added:(e.added||[]).map((e=>this._forTable(e))),moved:(e.moved||[]).map((e=>this._forTable(e))),removed:(e.removed||[]).map((e=>this._forTable(e))),target:this};this.emit("change",t)})),this._mapExtension.watch("map.tables.length",(()=>this.notifyChange("length")))}toJSON(){const e=[];return this.forEach((t=>{e.push(`item://${encodeURIComponent(d.TABLE_EXTENSION)}/${encodeURIComponent(t.id)}`)})),e}clone(){const e=new ae(this._mapExtension);return e._tableExtensionMap=this._tableExtensionMap,e}findById(e){return P("id",e).isNotMissing(),this.find((t=>t.id===e))}findByTableId(e){return P("id",e).isNotMissing(),this.find((t=>t._tableId===e))}forTable(e){if(P("table",e).isNotMissing(),this._tables.includes(e))return this._forTable(e)}add(e,t){if(P("tableX",e).isNotMissing(),e.mapExtension&&e.mapExtension.tableExtensions.remove(e),e._setMapExtension(this._mapExtension),e.table){const i=this._tableExtensionMap.get(e.table);if(this._tableExtensionMap.set(e.table,e),i&&i!==e&&this._onRemoved(i),this._tables.includes(e.table))if(void 0===t){const t={added:[e],moved:[],removed:i?[i]:[],target:this};this.emit("change",t)}else this._tables.reorder(e.table,t);else this._tables.add(e.table,t)}else{this._uninitializedTableExtensions.add(e);const t={added:[e],moved:[],removed:[],target:this};this.emit("change",t)}return this._onAdded(e),this}removeAt(e){const t=this.getItemAt(e);if(void 0!==t){if(this._uninitializedTableExtensions.has(t)){this._uninitializedTableExtensions.delete(t);const e={added:[],moved:[],removed:[t],target:this};this.emit("change",e)}else this._tables.remove(t.table);return this._onRemoved(t),t}}reorder(e,t){if(e&&this._tables.includes(e.table))return this._tables.reorder(e.table,t),e}sort(e){return this._tables.sort(((t,i)=>e(this._forTable(t),this._forTable(i)))),this}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.table}_onAdded(e){}_onRemoved(e){e._setMapExtension(void 0)}_forTable(e){for(const e of this._uninitializedTableExtensions)e._resolveTable(),e.table&&(this._tableExtensionMap.set(e.table,e),this._uninitializedTableExtensions.delete(e));if(!this._tableExtensionMap.has(e)){const t=c.create({table:e});this._tableExtensionMap.set(e,t),t._setMapExtension(this._mapExtension),this._onAdded(t)}return this._tableExtensionMap.get(e)}}class ne extends M{get _collection(){let e=this._mapExtension.layerExtensions.flatten((e=>V(e)?e.layerExtensions:[]));return this._mapExtension.basemapExtension&&(e=e.concat(this._mapExtension.basemapExtension.baseLayerExtensions.toArray()).concat(this._mapExtension.basemapExtension.referenceLayerExtensions.toArray())),e=e.concat(this._mapExtension.groundExtension.layerExtensions.toArray()),e}_mapExtension;constructor(e){super(),this._mapExtension=e}findById(e){return P("id",e).isNotMissing(),this.find((t=>t.id===e))}findByLayerId(e){return P("id",e).isNotMissing(),this.find((t=>t._layerId===e))}forLayer(e){return P("layer",e).isNotMissing(),this.findByLayerId(e.id)}emit(e,i){if("change"===e){const s=new t;s.addMany(i.added);const a=s.flatten((e=>V(e)?e.layerExtensions:[])).toArray(),n=new t;n.addMany(i.removed);const r=n.flatten((e=>V(e)?e.layerExtensions:[])).toArray(),o=new t;o.addMany(i.moved);const p=o.flatten((e=>V(e)?e.layerExtensions:[])).toArray();super.emit(e,{added:a,removed:r,moved:p,target:this})}return super.emit(e,i)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.layer}}function re(e){if("object"!=typeof e||!e?.baseMap)return J(e)}function oe(e){return"object"!=typeof e||e&&!e.baseMap}function pe(e,t,i){if(e?.type&&e.type!==i)throw new Error(`Invalid portal item type "${e.type}" for property ${t}.`)}async function he(e){await C(e),e.basemap&&(await C(e.basemap),e.basemap.baseLayers.filter((e=>L(e))).map((e=>{const t=e;return t.activeLayer.imageFormat=t.activeLayer.imageFormat??(t.activeLayer.imageFormats?.length>0?t.activeLayer.imageFormats[0]:""),t.activeLayer.styleId=t.activeLayer.styleId??"",t})),e.basemap.id=O(e.basemap)??e.basemap.id)}
1
+ import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import{ArgumentError as i}from"../ArgumentError.js";import{EntityBase as s}from"../Entity.js";import{InvalidOperationError as a}from"../InvalidOperationError.js";import{isBasemapExtension as n,isBookmark as o,isGroundExtension as r,isLayerPreset as p,isMenu as h,isTableExtension as m,ItemType as l}from"../ItemType.js";import{TableExtension as d}from"../data/TableExtension.js";import{layerToParentJsonCache as c}from"../json/LayerJson.js";import{applyJsonToWebMap as b}from"../json/WebMapJson.js";import{applyJsonToWebScene as _}from"../json/WebSceneJson.js";import{LayerPreset as u}from"../layer-preset/LayerPreset.js";import{Menu as w}from"../menus/Menu.js";import{DefaultArcGISRequestHelper as E}from"../support/ArcGISRequestHelper.js";import{FormatSettings as f}from"../support/FormatSettings.js";import{InitializableCollectionProxy as x}from"../support/InitializableCollectionProxy.js";import{ReadOnlyInitializableCollection as y}from"../support/ReadOnlyInitializableCollection.js";import{serializable as M}from"../support/Serializable.js";import{WellKnownBasemap as g}from"../support/esri.js";import{ReadOnlyCollection as I}from"../utilities/ReadOnlyCollection.js";import{basemapsAreEquivalent as v,createStandardBasemap as S,getStandardBasemapId as z,isStandardBasemap as O}from"../utilities/basemaps.js";import{checkArg as A}from"../utilities/checkArg.js";import{compare as P}from"../utilities/collection.js";import{load as T}from"../utilities/esri.js";import{isGroupLayerExtension as C}from"../utilities/extensions.js";import{filter as V}from"../utilities/iterable.js";import{isWMTSLayer as k,layersAreEquivalent as j}from"../utilities/layers.js";import{getLogger as B}from"../utilities/log.js";import{getMapSpatialReference as L,isMap as N,isWebMap as R,isWebScene as W}from"../utilities/mapping.js";import{toPortalItem as H}from"../utilities/portal.js";import{parallelEach as J}from"../utilities/promise.js";import{onCollectionPropertyChange as F,onEach as q}from"../utilities/watch.js";import{BasemapExtension as G}from"./BasemapExtension.js";import{Bookmark as D}from"./Bookmark.js";import{GroundExtension as U}from"./GroundExtension.js";import{MapConstraints as $}from"./MapConstraints.js";import{UnsupportedLayerExtension as X}from"./UnsupportedLayerExtension.js";import{_assignLayerExtensions as Y}from"./_LayerExtension.js";import{LayerExtensionCollectionImpl as K}from"./_LayerExtensionCollectionImpl.js";const Q=B("MapExtension");let Z=class extends s{get webMap(){return this._webMap}get webScene(){return this._webScene}get map(){return this._currentMap}get viewMode(){return this.map?W(this.map)?"scene":"map":this.initialViewMode}get initialViewMode(){return this.webMap&&this.webScene?this._initialViewMode||"map":W(this.map)||this.webScene&&!this.webMap?"scene":"map"}set initialViewMode(e){this._initialViewMode=e}get requestHelper(){return this._requestHelper||(this._requestHelper=new E),this._requestHelper}set requestHelper(e){this._requestHelper=e}get basemapExtension(){return this._basemapExtension}set basemapExtension(e){const t=this._basemapExtension;if(t!==e)if(t&&t._setMapExtension(void 0),e){if(e._setMapExtension(this),this.isInitialized&&!e.basemap){if(e.isInitialized)throw e._setMapExtension(void 0),new a("Cannot set MapExtension.basemapExtension without a valid Esri Basemap object");e.initialize()}this._ensureIsBasemapOption(e),this.map&&e.basemap&&e.basemap!==this.map.basemap?this.map.basemap=e.basemap:this._basemapExtension=e}else this.map.basemap=void 0,this._basemapExtension=void 0}get groundExtension(){return this._groundExtension||(this.groundExtension=U.create({ground:this.map?.ground})),this._groundExtension}set groundExtension(e){if(!e)throw new a("Cannot set map.ground to undefined");const t=this._groundExtension;t!==e&&(t&&t._setMapExtension(void 0),e._setMapExtension(this),e._resolveGround(),e.ground?(this._groundExtensions.set(e.ground,e),this.map&&e.ground!==this.map.ground?this.map.ground=e.ground:this._groundExtension=e):this._groundExtension=e)}get basemapOptions(){return this._basemapOptions}get bookmarks(){return this._bookmarks}get initialBasemapExtension(){return this._initialBasemapExtension}get initialLayerPreset(){return this._initialLayerPreset}set initialLayerPreset(e){if(!e)return void(this._initialLayerPreset=void 0);const t=p(e)?e:new u(e);this._initialLayerPreset=t}get _spatialReference(){return L(this.map)}get webMapItemTitle(){if(this._webMapItem)return this._webMapItem.title}get webSceneItemTitle(){if(this._webSceneItem)return this._webSceneItem.title}get title(){return this._title?this._title:this._webMapItem&&"map"===this.viewMode?this.webMapItemTitle:this._webSceneItem&&"scene"===this.viewMode?this.webSceneItemTitle:void 0}set title(e){this._title=e}formatSettings;constraints;onClick;onHover;onHoverEnd;onInitialized;onViewpointChanged;get contextMenu(){return this._contextMenu}set contextMenu(e){this._contextMenu=e,e&&this.isInitialized&&!e.isInitialized&&(async()=>{try{await e.initialize()}catch(e){e instanceof Error&&Q.error({message:"An error occurred while initializing context menu.",error:e})}})()}isSwitchingMap=!1;_layerViews=new t;get _allLayerViews(){const e=i=>{const s=[i];return t.isCollection(i.sublayerViews)?s.push(...i.sublayerViews.toArray().flatMap(e)):t.isCollection(i.layerViews)&&s.push(...i.layerViews.toArray().flatMap(e)),s};return this._layerViews.toArray().flatMap(e)}get layerExtensions(){return this._layerExtensions}tableExtensions;allLayerExtensions;_itemType=l.MAP_EXTENSION;_map;_scene;_deserializedMapPromise;_deserializedViewMode;_deserializedViewModePromise;_deferredProperties;_currentMap;_requestHelper;_basemapExtension;_groundExtension;_basemapOptions;_groundExtensions;_bookmarks;_layerExtensions;_webMap;_webMapItem;_webScene;_webSceneItem;_title;_initialViewMode;_initialLayerPreset;_initialBasemapExtension;_skipBasemapOptions=!1;_createScenePromise;_createMapPromise;_contextMenu;constructor(e){super(e);let s={...e};this._basemapOptions=new ee(this),this._groundExtensions=new WeakMap,this._layerExtensions=this._createLayerExtensionCollection(),this.tableExtensions=this._createTableExtensionCollection(),this.formatSettings=this._createFormatSettings(),this._bookmarks=new t,this.constraints=new $,this.watch(["_map","_scene"],(e=>{e&&(q(e.layers,"layerview-create",(e=>{this._layerViews.add(e.layerView)})),q(e.layers,"layerview-destroy",(e=>{this._layerViews.remove(e.layerView)})))}));const{webMap:a,webScene:n,initialViewMode:o,map:r,basemapOptions:p}=s;if(this._webMap=a,this._webScene=n,this._webMapItem=se(a),this._webSceneItem=se(n),this.initialViewMode=o,W(r)&&n)throw new i("Cannot specify webScene property if map is initialized to a WebScene instance.");if(N(r)&&a)throw new i("Cannot specify webMap property if map is initialized to a 2D Map instance.");if(W(r)||R(r)||N(r))this.assignProperties({basemapOptions:p}),this._skipBasemapOptions=!!p;else{const{layerExtensions:e,tableExtensions:t,groundExtension:i,basemapOptions:a,basemapExtension:n,...o}=s;this._deferredProperties={layerExtensions:e,tableExtensions:t,groundExtension:i,basemapOptions:a,basemapExtension:n},s=o,a&&(this._skipBasemapOptions=!0)}this._initMapFromProperties(s),this.watch("map.basemap",(()=>this._onBasemapChange()),!0),this.watch("map.ground",(()=>this._onGroundChange()),!0),this.allLayerExtensions=new ie(this),this.map?.basemap&&this._onBasemapChange()}getLayerExtensionsForView(e=this.viewMode){return(("map"===e?this._map:this._scene)?.layers.toArray()??[]).map((e=>this._layerExtensions._forLayer(e))).filter((e=>e instanceof X||!e.dynamicallyAddedLayer))}getAllFeatureSources(e=()=>!0){const t=[],i=a=>{a.hasFeatures&&t.push(a);for(const t of a.sublayerExtensions.initializedItems.filter(e).toArray())s(t);if(C(a))for(const t of a.layerExtensions.initializedItems.filter(e).toArray())i(t)},s=i=>{t.push(i);for(const t of i.sublayerExtensions.initializedItems.filter(e).toArray())s(t)};for(const t of this.layerExtensions.initializedItems.filter(e).toArray())i(t);for(const i of this.tableExtensions.initializedItems.filter(e).toArray())t.push(i);if(this.basemapExtension){for(const t of this.basemapExtension.baseLayerExtensions.initializedItems.filter(e).toArray())i(t);for(const t of this.basemapExtension.referenceLayerExtensions.initializedItems.filter(e).toArray())i(t)}return t}isSupportedViewMode(e){return e===this.viewMode||!(!this.webMap&&!this.webScene)&&("scene"===e?!!this.webScene:!!this.webMap)}async switchViewMode(e){if(A("viewMode",e).isNotMissing().satisfies((e=>this.isSupportedViewMode(e)),"Unsupported view mode."),this.viewMode===e)return;let t;"scene"===e?(await this._createScene(),t=this._scene):(await this._createMap(),t=this._map),t.basemap=this.map.basemap,await this.switchMap(t),this.notifyChange("viewMode"),this.notifyChange("title")}async switchMap(e){if(A("newMap",e).isNotMissing(),e===this.map)return;if(!this.map)return void this._setMap(e);this.isSwitchingMap=!0,this.isInitialized&&await oe(e);const t=new Map(this.map.layers.map((e=>[e,this.layerExtensions.forLayer(e)]))),i=new Map(this.map.tables.map((e=>[e,this.tableExtensions.forTable(e)]))),{basemapExtension:s}=this;this._setMap(e),this._updateBookmarks();const a=[];for(const e of this.map.layers.toArray()){const i=[...V(t.entries(),(([t])=>j(t,e)))];if(1===i.length){const[t]=i;a.push((async()=>{const i=t[1];await i._switchLayer(e),this._layerExtensions._register(i)})())}else{const t=this._layerExtensions._forLayer(e);t&&t.layer!==e&&a.push(t._switchLayer(e))}}for(const e of this.map.tables.toArray()){const t=[...V(i.entries(),(([t])=>j(t,e)))];if(1===t.length){const[i]=t;a.push((async()=>{const t=i[1];await t._switchTable(e),this.tableExtensions.add(t)})())}else{const t=this.tableExtensions.forTable(e);t&&t.table!==e&&a.push(t._switchTable(e))}}this.map.basemap&&s&&v(this.map.basemap,s.basemap)&&a.push((async()=>{await s._switchBasemap(this.map.basemap),this.basemapExtension=s})()),await Promise.all(a),this.isInitialized&&await this._initializeChildren(),this.isSwitchingMap=!1}async setWebMap(e){if(!e&&this.webMap&&!this.webScene)throw new a("Cannot unset both webMap and webScene.");this._webMap=e,this._map=void 0,this._createMapPromise=void 0,this._webMapItem=se(e),await T(this._webMapItem),"map"===this.viewMode&&(e?(this._basemapOptions.isExplicitlyModified||this._basemapOptions.removeAllInternal(),await this._createMap(),await this.switchMap(this._map),await this._createStandardBasemapOptions(),this._basemapOptions.reorderInternal(this.basemapExtension,0),this._initialBasemapExtension=this.basemapExtension):await this.switchViewMode("scene")),this.notifyChange("webMap"),this.notifyChange("initialViewMode"),this.notifyChange("title")}async setWebScene(e){if(!e&&this.webScene&&!this.webMap)throw new a("Cannot unset both webMap and webScene.");this._webScene=e,this._scene=void 0,this._createScenePromise=void 0,this._webSceneItem=se(e),await T(this._webSceneItem),"scene"===this.viewMode&&(e?(this._basemapOptions.isExplicitlyModified||this._basemapOptions.removeAllInternal(),await this._createScene(),await this.switchMap(this._scene),await this._createStandardBasemapOptions(),this._basemapOptions.reorderInternal(this.basemapExtension,0),this._initialBasemapExtension=this.basemapExtension):await this.switchViewMode("map")),this.notifyChange("webScene"),this.notifyChange("initialViewMode"),this.notifyChange("title")}getDefaults(){const e=super.getDefaults();return e.initialViewMode="map",e}async _createScene(){if(!this._scene&&this.webScene)return this._createScenePromise=this._createScenePromise??(async()=>{const e=(await import("@arcgis/core/WebScene")).default;ae(this.webScene)?(this._webSceneItem.type="Web Scene",this._scene=new e({portalItem:this._webSceneItem})):this._scene=e.fromJSON(this.webScene)})()}async _createMap(){if(!this._map&&this.webMap)return this._createMapPromise=this._createMapPromise??(async()=>{const e=(await import("@arcgis/core/WebMap")).default;ae(this.webMap)?(this._webMapItem.type="Web Map",this._map=new e({portalItem:this._webMapItem})):this._map=e.fromJSON(this.webMap)})()}_getSerializableProperties(){return{...super._getSerializableProperties(),layerExtensions:{serializeModes:["initial","project"],deserialize:e=>{if(this.map&&e){const t="map"===this.viewMode,i=(t?this._scene:this._map)?.layers.toArray()??[],s=e.filter((e=>!i.includes(e.layer)&&!i.some((t=>e.layer&&j(t,e.layer)))));Y(this.layerExtensions,s)}},serialize:e=>{if(this._deferredProperties?.layerExtensions)return this._deferredProperties.layerExtensions;{const t="map"===this.viewMode,i=(t?this._map:this._scene)?.layers.toArray();let s=(t?this._scene:this._map)?.layers.toArray()??[];return s=s.filter((e=>!i.find((t=>j(t,e))))),this.layerExtensions.concat(s.map((e=>this._layerExtensions._forLayer(e)))).filter((t=>!(t instanceof X||"initial"===e)||!t.dynamicallyAddedLayer)).toArray()}}},tableExtensions:{serializeModes:["initial","project"],deserialize:e=>{this.map?P(this.tableExtensions,e,{onNew:(e,t)=>{this.tableExtensions.add(m(e)?e:d.create(e),t)},onMatch:(e,t,i,s)=>{m(t)||e.assignProperties(t),i!==s&&this.tableExtensions.reorder(e,s)},equals:(e,t)=>m(t)?t===e:!!d._matchesRef(e,t.table)||e.id===t.id}):this._deferredProperties={...this._deferredProperties,tableExtensions:e}},serialize:()=>this._deferredProperties?.tableExtensions?this._deferredProperties?.tableExtensions:this.tableExtensions.toArray()},basemapExtension:{serializeModes:["project"],deserialize:e=>{if(this.map)if(e)if(n(e))this.basemapExtension=e;else{if(this.basemapExtension)return this.basemapExtension.assignPropertiesAsync(e);this.basemapExtension=G.create(e)}else this.basemapExtension=void 0;else this._deferredProperties={...this._deferredProperties,basemapExtension:e}},serialize:()=>this._deferredProperties?.basemapExtension?this._deferredProperties?.basemapExtension:this.basemapExtension},basemapOptions:{serializeModes:["initial"],deserialize:e=>{this._skipBasemapOptions?this._skipBasemapOptions=!1:(P(this.basemapOptions,e,{onNew:(e,t)=>{this.basemapOptions.add(n(e)?e:G.create(e),t)},onMatch:(e,t,i,s)=>{n(t)||e.assignProperties(t),i!==s&&this.basemapOptions.reorder(e,s)},onMissing:e=>{this.basemapOptions.remove(e)},equals:(e,t)=>{if(n(t))return t===e;if(e.id&&t.id)return e.id===t.id;{const i=e.toJSON();return v(i.basemap,t.basemap||t.baseMap)}}}),this.basemapExtension&&this._ensureIsBasemapOption(this.basemapExtension),this.isInitialized&&J(this.basemapOptions.toArray(),(e=>e._createBackingBasemap())))},serialize:()=>this._deferredProperties?.basemapOptions?this._deferredProperties?.basemapOptions:this.basemapOptions.toArray()},groundExtension:{serializeModes:["initial"],deserialize:e=>{if(this.map){if(!r(e))return this.groundExtension.assignPropertiesAsync(e);this.groundExtension=e}else this._deferredProperties={...this._deferredProperties,groundExtension:e}},serialize:()=>this._deferredProperties?.groundExtension?this._deferredProperties?.groundExtension:this.groundExtension},bookmarks:{serialize:()=>this.bookmarks.map((e=>e.toJSON())).toArray(),deserialize:e=>{this.bookmarks.addMany(e.map((e=>o(e)?e:new D(e))))}},webMap:{serializeModes:["initial"],deserialize:!1},webScene:{serializeModes:["initial"],deserialize:!1},initialLayerPreset:"initial",initialViewMode:{serializeModes:["initial","project"],serialize:e=>"project"===e?this.viewMode:"scene"!==this.initialViewMode||!this.webScene&&this.webMap?"map":"scene",deserialize:e=>{this.viewMode!==e&&(this._deserializedViewMode=e),this._initialViewMode=e},isDefault:(e,t)=>"project"!==t&&"map"===e},formatSettings:"initial",constraints:"initial",title:"initial",onClick:"initial",onHover:"initial",onHoverEnd:"initial",onInitialized:"initial",onViewpointChanged:"initial",contextMenu:{serializeModes:["initial"],deserialize:e=>{e?h(e)?this.contextMenu=e:this.contextMenu?this.contextMenu.assignProperties(e):this.contextMenu=w.create(e):this.contextMenu=void 0}},map:{serializeModes:["project"],serialize:()=>{c.lookup=new WeakMap;const e=this.layerExtensions.toArray().filter((e=>e.layer)).map((e=>e._getProjectWebmapJSON())),t=this.tableExtensions.toArray().filter((e=>e.table)).map((e=>({id:e.table.id,title:e.table.title})));return c.lookup=void 0,e.length>0||t.length>0?{operationalLayers:e,tables:t}:{}},deserialize:e=>{if(!this.map)throw new i("Cannot specify JSON object for the 'map' property. It must be an ArcGIS API Map instance. To specify JSON, use 'webMap' or 'webScene' instead.");if(N(e)||R(e)||W(e)){if(e!==this.map)throw new i("properties.map","Property 'map' is read-only.")}else this._deserializedMapPromise=(async()=>{this._deserializedViewMode&&this.webMap&&this.webScene&&(this._deserializedViewModePromise=this.switchViewMode(this._deserializedViewMode),await this._deserializedViewModePromise,this._deserializedViewMode=void 0,this._deserializedViewModePromise=void 0),await this._applyMapProperties(e,this.map),this._deserializedMapPromise=void 0})()}},requestHelper:{serialize:!1}}}async _applyMapProperties(e,t,i){await J(this.basemapOptions.toArray(),(e=>e._createBackingBasemap()));let s=e;const a=this.basemapOptions.find((e=>v(e.basemap,s.baseMap)));a&&(t.basemap=a.basemap,s={...s,baseMap:{...s.baseMap,title:t.basemap.title}}),W(t)?await _(s,t,i):await b(s,t,i)}_createFormatSettings(){return new f}_createLayerExtensionCollection(){return new K(this)}_createTableExtensionCollection(){return new te(this)}async _onInitialize(){await super._onInitialize();const{basemapOptions:e,basemapExtension:t,webMap:i,webScene:s,...a}=this._deferredProperties??{};if(this.map||("scene"===this.initialViewMode?(await this._createScene(),this._setMap(this._scene)):(await this._createMap(),this._setMap(this._map))),this._webMapItem||this._webSceneItem?(await Promise.all([oe(this.map),T(this._webMapItem),T(this._webSceneItem)]),ne(this._webMapItem,"webMap","Web Map"),ne(this._webSceneItem,"webScene","Web Scene")):await oe(this.map),t&&(!n(t)&&t.basemap?this.basemapExtension=G.create(t):await this.assignPropertiesAsync({basemapExtension:t}),await this.basemapExtension._createBackingBasemap()),e){const t=e.find((e=>n(e)&&v(this.map.basemap,e.toJSON().basemap)));if(t){const e=t.toJSON().basemap?.id??t.basemap?.id,i=t.toJSON().basemap?.title;await t._switchBasemap(this.map.basemap),this.basemapExtension=t,e&&(this.map.basemap.id=e),i&&(this.map.basemap.title=i)}await this.assignPropertiesAsync({basemapOptions:e})}await this.assignPropertiesAsync(a),this._deferredProperties=void 0,this._initialBasemapExtension=this.basemapExtension,this._updateBookmarks();for(const e of this.layerExtensions.toArray())await e._createBackingLayer();await Promise.all(this.tableExtensions.map((e=>e._createBackingTable())).toArray())}async _postInitialize(){await super._postInitialize(),await this._createStandardBasemapOptions(),await J(this.basemapOptions.toArray(),(e=>e._createBackingBasemap())),this.initialLayerPreset&&await this.initialLayerPreset.applyTo(this)}*_initializableChildCollections(){yield*super._initializableChildCollections();const e=new t(this.layerExtensions.filter((e=>!!e.layer)));e.remove=e=>this.layerExtensions.remove(e);const i=new t(this.tableExtensions.filter((e=>!!e.table)));if(i.remove=e=>this.tableExtensions.remove(e),yield e,yield i,this.basemapExtension){const e=new t;e.add(this.basemapExtension),yield e}const s=new t;s.add(this.groundExtension),yield s}_initMapFromProperties(e){const t=e.map;N(t)||R(t)||W(t)?this._setMap(t):"scene"===this.initialViewMode?e.webScene&&!ae(e.webScene)&&(this._deferredProperties={webScene:e.webScene,...this._deferredProperties}):e.webMap&&!ae(e.webMap)&&(this._deferredProperties={webMap:e.webMap,...this._deferredProperties})}_setMap(e){W(e)?this._scene=e:this._map=e,this._currentMap=e,this.basemapExtension?.basemap&&!e.basemap&&(e.basemap=this.basemapExtension.basemap),this.groundExtension?.ground&&!e.ground&&(e.ground=this.groundExtension.ground),this.notifyChange("map")}_onBasemapChange(){if(this._basemapExtension){if(this.basemapExtension.basemap==this.map.basemap)return;this._basemapExtension._setMapExtension(void 0)}if(this.map.basemap){let e=this.basemapOptions.find((e=>this.map.basemap===e.basemap));if(!e){const t=this.basemapOptions.find((e=>v(e.basemap,this.map.basemap)));t?(e=t,e._switchBasemap(this.map.basemap)):(e=G.create({basemap:this.map.basemap}),this._basemapOptions.addInternal(e,0))}e.mapExtension!==this&&e._setMapExtension(this),this._basemapExtension=e}else this._basemapExtension=void 0;this.notifyChange("basemapExtension")}_onGroundChange(){if(this._groundExtension){if(this.map.ground&&this.groundExtension.ground===this.map.ground)return void(this._groundExtensions.has(this.map.ground)||this._groundExtensions.set(this.map.ground,this.groundExtension));this.groundExtension._setMapExtension(void 0)}this.map.ground&&!this._groundExtensions.has(this.map.ground)&&this._groundExtensions.set(this.map.ground,U.create({ground:this.map.ground}));const e=this._groundExtensions.get(this.map.ground);e&&e.mapExtension!==this&&e._setMapExtension(this),this._groundExtension=e,this.notifyChange("groundExtension")}async _createStandardBasemapOptions(){const e=this._spatialReference;!this._basemapOptions.isExplicitlyModified&&e?.isWebMercator&&await J([g.SATELLITE,g.HYBRID_VECTOR,g.STREETS_VECTOR,g.TOPO_VECTOR,g.STREETS_NAVIGATION_VECTOR,g.STREETS_NIGHT_VECTOR,g.TERRAIN_VECTOR,g.DARK_GRAY_VECTOR,g.GRAY_VECTOR,g.OCEANS_VECTOR,g.OPEN_STREET_MAP_VECTOR],(async e=>{const t=await S(e);v(this.map.basemap,t)?this._basemapOptions.addInternal(this.basemapExtension):this._basemapOptions.addInternal(G.create({basemap:t}),void 0,!1)}))}_ensureIsBasemapOption(e){const t=this.basemapOptions.findIndex((t=>t.basemap===e.basemap));t>=0?this._basemapOptions.getItemAt(t)!==e&&(this._basemapOptions.removeAtInternal(t),this._basemapOptions.addInternal(e,t)):this._basemapOptions.addInternal(e,0)}_updateBookmarks(){this.bookmarks.removeMany(this.bookmarks.filter((e=>"map"===e.source))),R(this.map)&&this.map.bookmarks?.length>0?this.map.bookmarks.forEach((e=>{this.bookmarks.add(new D({source:"map",title:e.name,viewpoint:e.viewpoint}))})):W(this.map)&&this.map.presentation?.slides?.length>0&&this.map.presentation.slides.forEach((e=>{const t={source:"map",title:e.title.text,viewpoint:e.viewpoint},i=new D(t);this.bookmarks.add(i)}))}};Z=e([M],Z);export{Z as MapExtension};class ee extends x{isExplicitlyModified=!1;_mapExtension;constructor(e){super(new t),this._mapExtension=e}add(e,t){return super.add(e,t),this.isExplicitlyModified=!0,1===this.length&&this._mapExtension.map&&!this._mapExtension.basemapExtension&&(this._mapExtension.basemapExtension=e),this}addMany(e,t){return super.addMany(e,t),this.isExplicitlyModified=!0,this}addInternal(e,t,i=!0){const s=e=>{const t="-vector";return e?.endsWith(t)?e.substring(0,e.length-7):e};let a;if(e.basemap){const t=s(e.basemap.id);if(a=this.findIndex((e=>s(e.basemap?.id)===t)),O(e.basemap)&&a>=0){if(!i)return;super.removeAt(a)}}super.add(e,t??(a>=0?a:void 0))}removeAt(e){const t=super.removeAt(e);return t&&(this.isExplicitlyModified=!0,t===this._mapExtension.basemapExtension&&(e<this.length?this._mapExtension.basemapExtension=this.getItemAt(e):this.length?this._mapExtension.basemapExtension=this.getItemAt(e-1):this._mapExtension.basemapExtension=void 0)),t}removeAll(){return this._mapExtension.basemapExtension=void 0,super.removeAll()}removeAtInternal(e){return super.removeAt(e)}removeAllInternal(){for(;this.length;)this.removeAtInternal(this.length-1)}reorder(e,t){return super.reorder(e,t),this.isExplicitlyModified=!0,e}reorderInternal(e,t){return super.reorder(e,t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.basemap}}class te extends x{get _collection(){return this._tables.map((e=>this._forTable(e))).concat(Array.from(this._uninitializedTableExtensions))}get _tables(){return this._mapExtension.map?.tables??new I(new t)}_mapExtension;_tableExtensionMap=new WeakMap;_uninitializedTableExtensions=new Set;constructor(e){super(),this._mapExtension=e,F(this._mapExtension,"map.tables",(e=>{const t={added:(e.added||[]).map((e=>this._forTable(e))),moved:(e.moved||[]).map((e=>this._forTable(e))),removed:(e.removed||[]).map((e=>this._forTable(e))),target:this};this.emit("change",t)})),this._mapExtension.watch("map.tables.length",(()=>this.notifyChange("length")))}toJSON(){const e=[];return this.forEach((t=>{e.push(`item://${encodeURIComponent(l.TABLE_EXTENSION)}/${encodeURIComponent(t.id)}`)})),e}clone(){const e=new te(this._mapExtension);return e._tableExtensionMap=this._tableExtensionMap,e}findById(e){return A("id",e).isNotMissing(),this.find((t=>t.id===e))}findByTableId(e){return A("id",e).isNotMissing(),this.find((t=>t._tableId===e))}forTable(e){if(A("table",e).isNotMissing(),this._tables.includes(e))return this._forTable(e)}add(e,t){if(A("tableX",e).isNotMissing(),e.mapExtension&&e.mapExtension.tableExtensions.remove(e),e._setMapExtension(this._mapExtension),e.table){const i=this._tableExtensionMap.get(e.table);if(this._tableExtensionMap.set(e.table,e),i&&i!==e&&this._onRemoved(i),this._tables.includes(e.table))if(void 0===t){const t={added:[e],moved:[],removed:i?[i]:[],target:this};this.emit("change",t)}else this._tables.reorder(e.table,t);else this._tables.add(e.table,t)}else{this._uninitializedTableExtensions.add(e);const t={added:[e],moved:[],removed:[],target:this};this.emit("change",t)}return this._onAdded(e),this}removeAt(e){const t=this.getItemAt(e);if(void 0!==t){if(this._uninitializedTableExtensions.has(t)){this._uninitializedTableExtensions.delete(t);const e={added:[],moved:[],removed:[t],target:this};this.emit("change",e)}else this._tables.remove(t.table);return this._onRemoved(t),t}}reorder(e,t){if(e&&this._tables.includes(e.table))return this._tables.reorder(e.table,t),e}sort(e){return this._tables.sort(((t,i)=>e(this._forTable(t),this._forTable(i)))),this}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.table}_onAdded(e){}_onRemoved(e){e._setMapExtension(void 0)}_forTable(e){for(const e of this._uninitializedTableExtensions)e._resolveTable(),e.table&&(this._tableExtensionMap.set(e.table,e),this._uninitializedTableExtensions.delete(e));if(!this._tableExtensionMap.has(e)){const t=d.create({table:e});this._tableExtensionMap.set(e,t),t._setMapExtension(this._mapExtension),this._onAdded(t)}return this._tableExtensionMap.get(e)}}class ie extends y{get _collection(){let e=this._mapExtension.layerExtensions.flatten((e=>C(e)?e.layerExtensions:[]));return this._mapExtension.basemapExtension&&(e=e.concat(this._mapExtension.basemapExtension.baseLayerExtensions.toArray()).concat(this._mapExtension.basemapExtension.referenceLayerExtensions.toArray())),e=e.concat(this._mapExtension.groundExtension.layerExtensions.toArray()),e}_mapExtension;constructor(e){super(),this._mapExtension=e}findById(e){return A("id",e).isNotMissing(),this.find((t=>t.id===e))}findByLayerId(e){return A("id",e).isNotMissing(),this.find((t=>t._layerId===e))}forLayer(e){return A("layer",e).isNotMissing(),this.findByLayerId(e.id)}emit(e,i){if("change"===e){const s=new t;s.addMany(i.added);const a=s.flatten((e=>C(e)?e.layerExtensions:[])).toArray(),n=new t;n.addMany(i.removed);const o=n.flatten((e=>C(e)?e.layerExtensions:[])).toArray(),r=new t;r.addMany(i.moved);const p=r.flatten((e=>C(e)?e.layerExtensions:[])).toArray();super.emit(e,{added:a,removed:o,moved:p,target:this})}return super.emit(e,i)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.layer}}function se(e){if("object"!=typeof e||!e?.baseMap)return H(e)}function ae(e){return"object"!=typeof e||e&&!e.baseMap}function ne(e,t,i){if(e?.type&&e.type!==i)throw new Error(`Invalid portal item type "${e.type}" for property ${t}.`)}async function oe(e){await T(e),e.basemap&&(await T(e.basemap),e.basemap.baseLayers.filter((e=>k(e))).map((e=>{const t=e;return t.activeLayer.imageFormat=t.activeLayer.imageFormat??(t.activeLayer.imageFormats?.length>0?t.activeLayer.imageFormats[0]:""),t.activeLayer.styleId=t.activeLayer.styleId??"",t})),e.basemap.id=z(e.basemap)??e.basemap.id)}
@@ -0,0 +1,22 @@
1
+ import type { MapExtension } from "./MapExtension";
2
+ import { LayerExtensionCollectionBase } from "./support/_LayerExtensionCollection.js";
3
+ /**
4
+ * Backing implementation of
5
+ * {@link mapping/support/_LayerExtensionCollection!LayerExtensionCollection} for
6
+ * {@link mapping/MapExtension!MapExtension.layerExtensions}.
7
+ */
8
+ export declare class LayerExtensionCollectionImpl extends LayerExtensionCollectionBase {
9
+ /**
10
+ * @inheritDoc
11
+ */
12
+ protected get _mapExtension(): MapExtension;
13
+ /**
14
+ * The parent map extension that owns this collection.
15
+ */
16
+ protected readonly _parent: MapExtension;
17
+ constructor(parent: MapExtension);
18
+ /**
19
+ * Serializes the collection into JSON.
20
+ */
21
+ toJSON(): string[];
22
+ }
@@ -0,0 +1 @@
1
+ import{isLayerExtension as e,ItemType as t}from"../ItemType.js";import{LayerExtension as r}from"./_LayerExtension.js";import{LayerExtensionCollectionBase as n}from"./support/_LayerExtensionCollection.js";export class LayerExtensionCollectionImpl extends n{get _mapExtension(){return this._parent}constructor(e){super(e,"map.layers")}toJSON(){const e=[];return this.forEach((r=>{e.push(`item://${encodeURIComponent(t.LAYER_EXTENSION)}/${encodeURIComponent(r.id)}`)})),e}_forLayer(t){const n=this._mapExtension?._deferredProperties?.layerExtensions?.map((t=>e(t)?t:r.create(t)))??[];n?.length&&(this._mapExtension._deferredProperties.layerExtensions=n);for(const e of n)e.layer||e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this._mapExtension&&!e.mapExtension&&e._setMapExtension(this._mapExtension));return super._forLayer(t)}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vertigis/arcgis-extensions",
3
3
  "license": "SEE LICENSE IN LICENSE",
4
- "version": "48.0.0",
4
+ "version": "48.0.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://dev.azure.com/vertigis/Studio/_git/arcgis-extensions-ts"
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import r from"@arcgis/core/core/Collection";import{InvalidOperationError as i}from"../../InvalidOperationError.js";import{InitializableBase as o}from"../../support/InitializableBase.js";import{serializable as t}from"../../support/Serializable.js";import{isCancellation as s}from"../../support/utilities.js";import{groupBy as n}from"../../utilities/array.js";import{AsyncQueue as a}from"../../utilities/asyncIterable.js";import{checkArg as d}from"../../utilities/checkArg.js";import{parallelEach as u,reduce as p}from"../../utilities/promise.js";import{QueryError as c}from"./QueryError.js";import{QueryOptions as y}from"./QueryOptions.js";let l=class extends o{providers=new r;isSupported(e){return!!this.providers.find((r=>r.isSupported(e)))}query(e,r,o){d("source",e).isNotMissing().isNotEmpty(),d("where",r).isNotEmpty();const t=new a,l=Array.isArray(e)?e:[{source:e,where:r,options:o}],f=[];let h=0;const v=(e,r)=>{r&&0!==e.length&&(h++,(async()=>{if(t.isDone)return;const i=await p(e,(async(e,r)=>{const i={...y.DEFAULTS,...y.fromFeatureSource(r.source),...r.options};if(e.has(r.where)){const o=e.get(r.where);let t=!1;for(const{sources:e,options:s}of o)if(await y.areSameOptions(i,s)){e.push(r.source),t=!0;break}t||o.push({sources:[r.source],options:i})}else e.set(r.where,[{sources:[r.source],options:i}]);return e}),new Map);if(t.isDone)return;await u(e,(e=>e.source.initialize()));const o=[];for(const[e,n]of i){if(t.isDone)return;for(const i of n)o.push((async()=>{if(!t.isDone)try{const o=r.query(i.sources,e,i.options);for await(const e of o){if(t.isDone)return;i.options.outSpatialReference&&(e.schema.spatialReference=i.options.outSpatialReference),t.add(e)}}catch(e){s(e)?t.reject(e):e instanceof c?f.push(e):f.push([i.sources,e])}})())}await Promise.all(o),t.done(),0==--h&&(f.length?t.reject(new c(f)):t.done())})())};return(async()=>{await this.initialize(),n(l,(e=>this.providers.find((r=>r.isSupported(e.source))))).forEach(v),0===h&&t.reject(new i("Unable to query: no provider registered for this type of feature source."))})(),t}async count(e,r,o){d("source",e).isNotMissing(),d("where",r).isNotMissing(),await this.initialize();const t=this.providers.find((r=>r.isSupported(e)));if(!t)throw new i("Unable to query: no provider registered for this type of feature source.");try{await e.initialize();const i={returnGeometry:!1,outFields:void 0};return await t.count(e,r,{...y.fromFeatureSource(e),...o,...i})}catch(r){throw s(r)?r:new c([[e,r]])}}async _onInitialize(){await super._onInitialize();const{ArcGISServiceTableQueryProvider:e,ArcGISSublayerQueryProvider:r,BuildingComponentSublayerClientSideQueryProvider:i,CSVLayerClientSideQueryProvider:o,FeatureLayerQueryProvider:t,GeoJSONLayerClientSideQueryProvider:s,GeoRSSLayerQueryProvider:n,ImageryLayerQueryProvider:a,KMLLayerQueryProvider:d,MapNotesSublayerQueryProvider:u,RouteLayerQueryProvider:p,SceneLayerClientSideQueryProvider:c,SceneLayerQueryProvider:y,StreamLayerClientSideQueryProvider:l,SubtypeSublayerQueryProvider:f,WFSLayerQueryProvider:h}=await import("./defaultProviders.js");this.providers.add(new e),this.providers.add(new r),this.providers.add(new o),this.providers.add(new t),this.providers.add(new s),this.providers.add(new n),this.providers.add(new a),this.providers.add(new d),this.providers.add(new i),this.providers.add(new c),this.providers.add(new y),this.providers.add(new l),this.providers.add(new f),this.providers.add(new p),this.providers.add(new u),this.providers.add(new h)}};l=e([t],l);export{l as QueryService};
1
+ import{__decorate as e}from"tslib";import r from"@arcgis/core/core/Collection";import{InvalidOperationError as i}from"../../InvalidOperationError.js";import{InitializableBase as o}from"../../support/InitializableBase.js";import{serializable as t}from"../../support/Serializable.js";import{isCancellation as s}from"../../support/utilities.js";import{groupBy as n}from"../../utilities/array.js";import{AsyncQueue as a}from"../../utilities/asyncIterable.js";import{checkArg as d}from"../../utilities/checkArg.js";import{parallelEach as u,reduce as p}from"../../utilities/promise.js";import{QueryError as c}from"./QueryError.js";import{QueryOptions as y}from"./QueryOptions.js";let l=class extends o{providers=new r;isSupported(e){return!!this.providers.find((r=>r.isSupported(e)))}query(e,r,o){d("source",e).isNotMissing().isNotEmpty(),d("where",r).isNotEmpty();const t=new a,l=Array.isArray(e)?e:[{source:e,where:r,options:o}],f=[];let h=0;const v=(e,r)=>{r&&0!==e.length&&(h++,(async()=>{if(t.isDone)return;const i=await p(e,(async(e,r)=>{const i={...y.DEFAULTS,...y.fromFeatureSource(r.source),...r.options};if(e.has(r.where)){const o=e.get(r.where);let t=!1;for(const{sources:e,options:s}of o)if(await y.areSameOptions(i,s)){e.push(r.source),t=!0;break}t||o.push({sources:[r.source],options:i})}else e.set(r.where,[{sources:[r.source],options:i}]);return e}),new Map);if(t.isDone)return;await u(e,(e=>e.source.initialize()));const o=[];for(const[e,n]of i){if(t.isDone)return;for(const i of n)o.push((async()=>{if(!t.isDone)try{const o=r.query(i.sources,e,i.options);for await(const e of o){if(t.isDone)return;i.options.outSpatialReference&&(e.schema.spatialReference=i.options.outSpatialReference),t.add(e)}}catch(e){s(e)?t.reject(e):e instanceof c?f.push(e):f.push([i.sources,e])}})())}await Promise.all(o),0==--h&&(f.length?t.reject(new c(f)):t.done())})())};return(async()=>{await this.initialize(),n(l,(e=>this.providers.find((r=>r.isSupported(e.source))))).forEach(v),0===h&&t.reject(new i("Unable to query: no provider registered for this type of feature source."))})(),t}async count(e,r,o){d("source",e).isNotMissing(),d("where",r).isNotMissing(),await this.initialize();const t=this.providers.find((r=>r.isSupported(e)));if(!t)throw new i("Unable to query: no provider registered for this type of feature source.");try{await e.initialize();const i={returnGeometry:!1,outFields:void 0};return await t.count(e,r,{...y.fromFeatureSource(e),...o,...i})}catch(r){throw s(r)?r:new c([[e,r]])}}async _onInitialize(){await super._onInitialize();const{ArcGISServiceTableQueryProvider:e,ArcGISSublayerQueryProvider:r,BuildingComponentSublayerClientSideQueryProvider:i,CSVLayerClientSideQueryProvider:o,FeatureLayerQueryProvider:t,GeoJSONLayerClientSideQueryProvider:s,GeoRSSLayerQueryProvider:n,ImageryLayerQueryProvider:a,KMLLayerQueryProvider:d,MapNotesSublayerQueryProvider:u,RouteLayerQueryProvider:p,SceneLayerClientSideQueryProvider:c,SceneLayerQueryProvider:y,StreamLayerClientSideQueryProvider:l,SubtypeSublayerQueryProvider:f,WFSLayerQueryProvider:h}=await import("./defaultProviders.js");this.providers.add(new e),this.providers.add(new r),this.providers.add(new o),this.providers.add(new t),this.providers.add(new s),this.providers.add(new n),this.providers.add(new a),this.providers.add(new d),this.providers.add(new i),this.providers.add(new c),this.providers.add(new y),this.providers.add(new l),this.providers.add(new f),this.providers.add(new p),this.providers.add(new u),this.providers.add(new h)}};l=e([t],l);export{l as QueryService};
@@ -1 +1 @@
1
- import{executeQuery as e,executeCount as t,concatenateWhereClauses as r,constrainQueryTimeExtentToView as s}from"../../support/_query.js";import{isSubtypeSublayer as o}from"../../utilities/_layers.js";import{AsyncQueue as u}from"../../utilities/asyncIterable.js";import{removeZValues as i}from"../../utilities/geometry.js";import{caseInsensitiveEquals as a}from"../../utilities/string.js";import{QueryOptions as l}from"./QueryOptions.js";import{QueryProviderBase as n}from"./QueryProviderBase.js";export class SubtypeSublayerQueryProvider extends n{isSupported(e){const{sublayer:t}=e;return o(t)&&t.layer&&e.layerExtension?.capabilities.supportsQuery}_query(t,s,o){const{sublayer:u}=t,i=this._createQuery(u.layer,o,o.outFields??t.featureSettings.outFields);return i.where=r(`${u.layer.subtypeField}=${u.subtypeCode}`,s),e(i,t,u.layer,o.cancelToken)}_queryMany(t,o,i){if(1===t.length){const e={...l.DEFAULTS,...l.fromFeatureSource(t[0]),...i};return this._query(t[0],o,e)}const n=new u,y=t.length;let c=0;const p=t.reduce(((e,t)=>{const r=t,s={...l.DEFAULTS,...l.fromFeatureSource(r),...i},o=s.outFields??r.featureSettings.outFields;if(e.has(r.sublayer.layer)){const t=e.get(r.sublayer.layer);let i=!1;for(const{sources:e,queryOptions:l,outFields:y}of t)if(n=s,(u=l).returnGeometry===n.returnGeometry&&(u.outSpatialReference===n.outSpatialReference||u.outSpatialReference?.equals(n.outSpatialReference))&&u.maxAllowableOffset===n.maxAllowableOffset&&o.length===y.length&&o.every((e=>y.some((t=>a(e,t)))))){e.push(r),i=!0;break}i||t.push({sources:[r],queryOptions:s,outFields:o})}else e.set(r.sublayer.layer,[{sources:[r],queryOptions:s,outFields:o}]);var u,n;return e}),new Map);for(const[t,u]of p)for(const{sources:i,queryOptions:l,outFields:p}of u)(async()=>{if(n.isDone)return;const u=new Map,f=[];for(const e of i)u.set(e.sublayer.subtypeCode,e),f.push(e.sublayer.subtypeCode);const d=this._createQuery(t,l,p);let b=!1;d.outFields.some((e=>"*"===e||a(e,t.subtypeField)))||(b=!0,d.outFields=[...d.outFields,t.subtypeField]),d.where=r(`${t.subtypeField} IN (${f.join(",")})`,o),s(d,i[0]);try{for await(const r of e(d,(e=>{if(null!=e.attributes){const r=e.attributes;let s=r[t.subtypeField];if(void 0===s){s=r[Object.keys(r).find((e=>a(e,t.subtypeField)))]}return u.get(s)}}),t,l.cancelToken)){if(n.isDone)return;b&&r.attributes.delete(t.subtypeField),n.add(r)}}catch(e){n.reject(e)}finally{c+=i.length,c===y&&n.done()}})();return n}_count(e,s,o){const{sublayer:u}=e,i=this._createBasicQuery(u.layer,o,o.outFields??e.featureSettings.outFields);return i.where=r(`${u.layer.subtypeField}=${u.subtypeCode}`,s),t(i,e,u.layer,o.cancelToken)}_createQuery(e,t,r){const s=this._createBasicQuery(e,t,r);return s.outSpatialReference=t.outSpatialReference,s.maxAllowableOffset=t.maxAllowableOffset,s.returnZ=e.hasZ,s}_createBasicQuery(e,t,r){const s=e.createQuery();s.outFields=r,s.returnGeometry=t.returnGeometry;let o=t.spatialFilter;return o&&(s.spatialRelationship="intersects",!o||e.hasZ&&e.capabilities?.data?.supportsZ||(o=i(o.clone())),s.geometry=o),e.capabilities.query.supportsPagination&&(s.num=t.maxResults),s}}
1
+ import{executeQuery as e,executeCount as t,concatenateWhereClauses as r,constrainQueryTimeExtentToView as s}from"../../support/_query.js";import{isSubtypeSublayer as o}from"../../utilities/_layers.js";import{AsyncQueue as u}from"../../utilities/asyncIterable.js";import{removeZValues as i}from"../../utilities/geometry.js";import{caseInsensitiveEquals as a}from"../../utilities/string.js";import{QueryOptions as l}from"./QueryOptions.js";import{QueryProviderBase as n}from"./QueryProviderBase.js";export class SubtypeSublayerQueryProvider extends n{isSupported(e){const{sublayer:t}=e;return o(t)&&t.layer&&e.layerExtension?.capabilities.supportsQuery}_query(t,s,o){const{sublayer:u}=t,i=this._createQuery(u.layer,o,o.outFields??t.featureSettings.outFields);return i.where=r(`${u.layer.subtypeField}=${u.subtypeCode}`,s),e(i,t,u.layer,o.cancelToken)}_queryMany(t,o,i){if(1===t.length){const e={...l.DEFAULTS,...l.fromFeatureSource(t[0]),...i};return this._query(t[0],o,e)}const n=new u,y=t.length;let c=0;const p=t.reduce(((e,t)=>{const r=t,s={...l.DEFAULTS,...l.fromFeatureSource(r),...i},o=s.outFields??r.featureSettings.outFields;if(e.has(r.sublayer.layer)){const t=e.get(r.sublayer.layer);let i=!1;for(const{sources:e,queryOptions:l,outFields:y}of t)if(n=s,(u=l).returnGeometry===n.returnGeometry&&(u.outSpatialReference===n.outSpatialReference||u.outSpatialReference?.equals(n.outSpatialReference))&&u.maxAllowableOffset===n.maxAllowableOffset&&o.length===y.length&&o.every((e=>y.some((t=>a(e,t)))))){e.push(r),i=!0;break}i||t.push({sources:[r],queryOptions:s,outFields:o})}else e.set(r.sublayer.layer,[{sources:[r],queryOptions:s,outFields:o}]);var u,n;return e}),new Map);for(const[t,u]of p)for(const{sources:i,queryOptions:l,outFields:p}of u)(async()=>{if(n.isDone)return;const u=new Map,f=[];for(const e of i)u.set(e.sublayer.subtypeCode,e),f.push(e.sublayer.subtypeCode);const d=this._createQuery(t,l,p);let b=!1;d.outFields.some((e=>"*"===e||a(e,t.subtypeField)))||(b=!0,d.outFields=[...d.outFields,t.subtypeField]),d.where="1=1"===o?"":o,d.where=r(`${t.subtypeField} IN (${f.join(",")})`,d.where),s(d,i[0]);try{for await(const r of e(d,(e=>{if(null!=e.attributes){const r=e.attributes;let s=r[t.subtypeField];if(void 0===s){s=r[Object.keys(r).find((e=>a(e,t.subtypeField)))]}return u.get(s)}}),t,l.cancelToken)){if(n.isDone)return;b&&r.attributes.delete(t.subtypeField),n.add(r)}}catch(e){n.reject(e)}finally{c+=i.length,c===y&&n.done()}})();return n}_count(e,s,o){const{sublayer:u}=e,i=this._createBasicQuery(u.layer,o,o.outFields??e.featureSettings.outFields);return i.where=r(`${u.layer.subtypeField}=${u.subtypeCode}`,s),t(i,e,u.layer,o.cancelToken)}_createQuery(e,t,r){const s=this._createBasicQuery(e,t,r);return s.outSpatialReference=t.outSpatialReference,s.maxAllowableOffset=t.maxAllowableOffset,s.returnZ=e.hasZ,s}_createBasicQuery(e,t,r){const s=e.createQuery();s.outFields=r,s.returnGeometry=t.returnGeometry;let o=t.spatialFilter;return o&&(s.spatialRelationship="intersects",!o||e.hasZ&&e.capabilities?.data?.supportsZ||(o=i(o.clone())),s.geometry=o),e.capabilities.query.supportsPagination&&(s.num=t.maxResults),s}}
package/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The current version of the Geocortex ArcGIS Extensions API.
3
3
  */
4
- export declare const version = "48.0.0";
4
+ export declare const version = "48.0.2";
package/version.js CHANGED
@@ -1 +1 @@
1
- export const version="48.0.0";
1
+ export const version="48.0.2";