@vertigis/arcgis-extensions 54.2.0 → 54.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Entity.d.ts +1 -1
- package/Hyperlink.d.ts +6 -6
- package/Hyperlink.js +1 -1
- package/LanguageResources.d.ts +1 -1
- package/LanguageResources.js +1 -1
- package/PortalUri.d.ts +2 -2
- package/data/Attachment.d.ts +9 -9
- package/data/Feature.js +1 -1
- package/data/RelationshipBase.d.ts +3 -3
- package/data/Schema.js +1 -1
- package/data/_Relationship.d.ts +4 -4
- package/data/_Relationship.js +1 -1
- package/data/support/_lpkxConverter.js +1 -1
- package/data/support/lpkxInterfaces.d.ts +8 -0
- package/declarations/arcgis-js-api-extensions/index.d.ts +7 -7
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/PortalUri.PortalUri.html +4 -4
- package/docs/html/classes/data_RelationshipBase.RelationshipBase.html +2 -2
- package/docs/html/classes/support_Cancellable.Cancellation.html +2 -2
- package/docs/html/classes/tasks_identify_ArcGISSublayerIdentifyProvider.ArcGISSublayerIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_ArcGISSublayerQueryIdentifyProvider.ArcGISSublayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_BuildingComponentSublayerClientSideIdentifyProvider.BuildingComponentSublayerClientSideIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_BuildingComponentSublayerHitTestIdentifyProvider.BuildingComponentSublayerHitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_CSVLayer3DHitTestIdentifyProvider.CSVLayer3DHitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_CSVLayerClientSideQueryIdentifyProvider.CSVLayerClientSideQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_ClientSideIdentifyProvider.ClientSideIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_FeatureLayer3DHitTestIdentifyProvider.FeatureLayer3DHitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_FeatureLayerClientSideIdentifyProvider.FeatureLayerClientSideIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_FeatureLayerQueryIdentifyProvider.FeatureLayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_GeoJSONLayer3DHitTestIdentifyProvider.GeoJSONLayer3DHitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_GeoJSONLayerClientSideQueryIdentifyProvider.GeoJSONLayerClientSideQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_GeoRSSLayerIdentifyProvider.GeoRSSLayerIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_GraphicsLayerQueryIdentifyProvider.GraphicsLayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_HitTestIdentifyProvider.HitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html +2 -2
- package/docs/html/classes/tasks_identify_ImageryLayerIdentifyProvider.ImageryLayerIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_KMLLayerQueryIdentifyProvider.KMLLayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_MapNotesSublayerQueryIdentifyProvider.MapNotesSublayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_PointCloudLayerHitTestIdentifyProvider.PointCloudLayerHitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_RouteLayerQueryIdentifyProvider.RouteLayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_SceneLayerClientSideIdentifyProvider.SceneLayerClientSideIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_SceneLayerHitTestIdentifyProvider.SceneLayerHitTestIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_SceneLayerQueryIdentifyProvider.SceneLayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_StreamLayerClientSideQueryIdentifyProvider.StreamLayerClientSideQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_SubtypeSublayerClientSideIdentifyProvider.SubtypeSublayerClientSideIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_WFSLayerClientSideIdentifyProvider.WFSLayerClientSideIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_WFSLayerQueryIdentifyProvider.WFSLayerQueryIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_WMSLayerFeatureInfoIdentifyProvider.WMSLayerFeatureInfoIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_identify_WMSSublayerIdentifyProvider.WMSSublayerIdentifyProvider.html +2 -2
- package/docs/html/classes/tasks_query_ArcGISRelationship.ArcGISRelationship.html +2 -2
- package/docs/html/classes/tasks_query_QueryBasedRelationship.QueryBasedRelationship.html +2 -2
- package/docs/html/classes/tasks_search_ArcGISGeocoderSearchProvider.ArcGISGeocoderSearchProvider.html +3 -3
- package/docs/html/classes/tasks_search_GeocoderSearchProvider.GeocoderSearchProvider.html +3 -3
- package/docs/html/classes/utilities_CaseInsensitiveObservableMap.CaseInsensitiveObservableMap.html +2 -2
- package/docs/html/functions/data__Relationship.fromEsriApiCardinality.html +1 -1
- package/docs/html/functions/data__Relationship.toEsriApiCardinality.html +1 -1
- package/docs/html/functions/support_InitializableBase.initializeCollection.html +1 -1
- package/docs/html/functions/support_Serializable.filterJSONProperties.html +1 -1
- package/docs/html/interfaces/data_Attachment.AttachmentInfo.html +8 -8
- package/docs/html/interfaces/data__Relationship.Relationship-1.html +5 -5
- package/docs/html/interfaces/data_support_lpkxInterfaces.LyrxLayerDefinition.html +7 -4
- package/docs/html/interfaces/support_InitializableBase.InitializeWarningEvent.html +3 -3
- package/docs/html/types/support_Serializable.SerializableClass.html +1 -1
- package/docs/html/variables/version.version.html +1 -1
- package/layer-preset/LayerPreset.d.ts +7 -7
- package/layer-preset/LayerPreset.js +1 -1
- package/locale/language.d.ts +4 -4
- package/locale/language.js +1 -1
- package/mapping/Bookmark.d.ts +3 -3
- package/mapping/support/featureService.js +1 -1
- package/menus/Menu.d.ts +1 -1
- package/menus/Menu.js +1 -1
- package/menus/MenuItem.d.ts +12 -12
- package/menus/MenuItem.js +1 -1
- package/package.json +1 -1
- package/support/Cancellable.d.ts +2 -2
- package/support/InitializableBase.d.ts +1 -1
- package/support/InitializableBase.js +1 -1
- package/support/Serializable.d.ts +3 -2
- package/support/Serializable.js +1 -1
- package/support/_ArcGISRelationshipCollection.js +1 -1
- package/support/_featureEdit.js +1 -1
- package/support/_graphicsQuery.js +1 -1
- package/support/_query.js +1 -1
- package/tasks/identify/ArcGISSublayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/ClientSideIdentifyProvider.d.ts +1 -1
- package/tasks/identify/ClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/GeoJSONLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/HitTestIdentifyProvider.d.ts +1 -1
- package/tasks/identify/HitTestIdentifyProvider.js +1 -1
- package/tasks/identify/IdentifyProviderBase.d.ts +1 -1
- package/tasks/identify/IdentifyService.js +1 -1
- package/tasks/identify/ImageryLayerIdentifyProvider.js +1 -1
- package/tasks/identify/SubtypeSublayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/WFSLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/WMSLayerFeatureInfoIdentifyProvider.js +1 -1
- package/tasks/identify/WMSSublayerIdentifyProvider.js +1 -1
- package/tasks/query/ArcGISRelationship.js +1 -1
- package/tasks/query/ArcGISSublayerQueryProvider.js +1 -1
- package/tasks/query/CSVLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/ClientSideQueryProvider.js +1 -1
- package/tasks/query/FeatureLayerQueryProvider.js +1 -1
- package/tasks/query/GeoJSONLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/SceneLayerQueryProvider.js +1 -1
- package/tasks/query/SubtypeSublayerQueryProvider.js +1 -1
- package/tasks/query/WFSLayerQueryProvider.js +1 -1
- package/tasks/search/ArcGISGeocoderSearchProvider.d.ts +2 -1
- package/tasks/search/ArcGISGeocoderSearchProvider.js +1 -1
- package/tasks/search/GeocoderSearchProvider.d.ts +4 -3
- package/tasks/search/GeocoderSearchProvider.js +1 -1
- package/tasks/search/SearchProviderBase.js +1 -1
- package/tasks/search/SearchService.js +1 -1
- package/tasks/search/_utilities.js +1 -1
- package/utilities/CaseInsensitiveObservableMap.d.ts +2 -2
- package/utilities/CaseInsensitiveObservableMap.js +1 -1
- package/utilities/arcade.js +1 -1
- package/utilities/uri.d.ts +1 -1
- package/utilities/uri.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/menus/MenuItem.d.ts
CHANGED
|
@@ -88,32 +88,32 @@ export declare class MenuItem<TMenuItemProps extends MenuItemProperties = MenuIt
|
|
|
88
88
|
/**
|
|
89
89
|
* A submenu associated with this item.
|
|
90
90
|
*/
|
|
91
|
-
get submenu(): Menu<TMenuItemProps, TMenuProps, this
|
|
92
|
-
set submenu(value: Menu<TMenuItemProps, TMenuProps, this>);
|
|
91
|
+
get submenu(): Menu<TMenuItemProps, TMenuProps, this> | undefined;
|
|
92
|
+
set submenu(value: Menu<TMenuItemProps, TMenuProps, this> | undefined);
|
|
93
93
|
/**
|
|
94
94
|
* The parent menu that this item belongs to.
|
|
95
95
|
*/
|
|
96
|
-
get menu(): Menu<TMenuItemProps, TMenuProps, this
|
|
96
|
+
get menu(): Menu<TMenuItemProps, TMenuProps, this> | undefined;
|
|
97
97
|
/**
|
|
98
98
|
* The root menu in the menu hierarchy.
|
|
99
99
|
*/
|
|
100
|
-
get root(): Menu<TMenuItemProps, TMenuProps, this
|
|
100
|
+
get root(): Menu<TMenuItemProps, TMenuProps, this> | undefined;
|
|
101
101
|
/**
|
|
102
102
|
* The ID of the icon to show for this item, e.g. "gcx-icon-zoom-in".
|
|
103
103
|
*/
|
|
104
|
-
get iconId(): string;
|
|
105
|
-
set iconId(value: string);
|
|
104
|
+
get iconId(): string | undefined;
|
|
105
|
+
set iconId(value: string | undefined);
|
|
106
106
|
/**
|
|
107
107
|
* The human-readable caption for the item.
|
|
108
108
|
*/
|
|
109
|
-
get title(): string;
|
|
110
|
-
set title(value: string);
|
|
109
|
+
get title(): string | undefined;
|
|
110
|
+
set title(value: string | undefined);
|
|
111
111
|
/**
|
|
112
112
|
* A longer description explaining what the item does, typically displayed
|
|
113
113
|
* in a tooltip.
|
|
114
114
|
*/
|
|
115
|
-
get description(): string;
|
|
116
|
-
set description(value: string);
|
|
115
|
+
get description(): string | undefined;
|
|
116
|
+
set description(value: string | undefined);
|
|
117
117
|
/**
|
|
118
118
|
* Determines whether the user is able to select this item.
|
|
119
119
|
*/
|
|
@@ -129,8 +129,8 @@ export declare class MenuItem<TMenuItemProps extends MenuItemProperties = MenuIt
|
|
|
129
129
|
/**
|
|
130
130
|
* Indicates which action to perform when this item is selected.
|
|
131
131
|
*/
|
|
132
|
-
get action(): Action;
|
|
133
|
-
set action(value: Action);
|
|
132
|
+
get action(): Action | undefined;
|
|
133
|
+
set action(value: Action | undefined);
|
|
134
134
|
/**
|
|
135
135
|
* The alternate state to set when the menu item is toggled.
|
|
136
136
|
*/
|
package/menus/MenuItem.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e;import{__decorate as t}from"tslib";import i from"@arcgis/core/core/Collection";import{EntityBase as s}from"../Entity.js";import{InvalidOperationError as n}from"../InvalidOperationError.js";import{isMenu as r,ItemType as a}from"../ItemType.js";import{serializable as o}from"../support/Serializable.js";import{objectKeys as u}from"../utilities/object.js";import{Menu as l}from"./Menu.js";let h=class extends s{static{e=this}static factory;_menu;_itemType=a.MENU_ITEM;_isToggled=!1;_submenu;_iconId;_isEnabled=!0;_description;_title;_hideOnDisable=!1;_action;_alternate;constructor(e){super(e),this._isToggled=e?.isToggled??!1}get canBeToggled(){return!!this.alternate}get isToggled(){return this._isToggled}get submenu(){return this._submenu}set submenu(e){if(e&&this._createsCircularReference(this._allSubmenus(e)))throw new n("Menu is already part of the menu hierarchy.");this._submenu&&
|
|
1
|
+
var e;import{__decorate as t}from"tslib";import i from"@arcgis/core/core/Collection";import{EntityBase as s}from"../Entity.js";import{InvalidOperationError as n}from"../InvalidOperationError.js";import{isMenu as r,ItemType as a}from"../ItemType.js";import{serializable as o}from"../support/Serializable.js";import{objectKeys as u}from"../utilities/object.js";import{Menu as l}from"./Menu.js";let h=class extends s{static{e=this}static factory;_menu;_itemType=a.MENU_ITEM;_isToggled=!1;_submenu;_iconId;_isEnabled=!0;_description;_title;_hideOnDisable=!1;_action;_alternate;constructor(e){super(e),this._isToggled=e?.isToggled??!1}get canBeToggled(){return!!this.alternate}get isToggled(){return this._isToggled}get submenu(){return this._submenu}set submenu(e){if(e&&this._createsCircularReference(this._allSubmenus(e)))throw new n("Menu is already part of the menu hierarchy.");this._submenu&&(this._submenu._parentItem=void 0),this._submenu=e,this._submenu&&(this._submenu._parentItem=this)}get menu(){return this._menu}get root(){return this.menu?.parentItem?.root?this.menu.parentItem.root:this.menu}get iconId(){return this._iconId}set iconId(e){this._iconId=e}get title(){return this._title}set title(e){this._title=e}get description(){return this._description}set description(e){this._description=e}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled=e}get hideOnDisable(){return this._hideOnDisable}set hideOnDisable(e){this._hideOnDisable=e}get action(){return this._action}set action(e){this._action=e}get alternate(){return this._alternate}set alternate(e){this._alternate=e}static create(t){if(!e.factory)throw new n("Cannot create menu item: no menu item factory has been registered.");return e.factory.create(t)}toggle(){if(!this.canBeToggled)throw new n("This menu item cannot be toggled. Set `alternate` to enable toggling.");this._isToggled=!this._isToggled;for(const e of u(this.alternate)){const t=this.alternate[e];this.alternate[e]=this[e],this[e]=t}}async _onInitialize(){await super._onInitialize(),this.submenu&&await this.submenu.initialize()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconId:"initial",title:"initial",description:"initial",isEnabled:{serializeModes:["initial"],default:!0},hideOnDisable:{serializeModes:["initial"],default:!1},isToggled:{serializeModes:["initial"],deserialize:!1,default:!1},action:"initial",alternate:{serializeModes:["initial"],deserialize:e=>{this.alternate=e?{...e}:void 0}},submenu:{serializeModes:["initial"],deserialize:e=>{e?r(e)?this.submenu=e:this.submenu?this.submenu.assignProperties(e):this.submenu=l.create(e):this.submenu=void 0}}}}_createsCircularReference(e,t,i){if(!t&&!this.menu)return!1;const s=t??this.menu,n=i??(this.menu?.parentItem?.root?this.menu.parentItem.root:this.menu);if(s&&e.includes(s))return!0;if(s===n)return!1;const r=s?.parentItem?.menu;return this._createsCircularReference(e,r,n)}_allSubmenus(e){const t=new i;t.add(e);for(const i of e.items.toArray())i.submenu&&t.addMany(this._allSubmenus(i.submenu));return t}};h=e=t([o],h);export{h as MenuItem};h.factory={create:e=>new h(e)};
|
package/package.json
CHANGED
package/support/Cancellable.d.ts
CHANGED
|
@@ -30,11 +30,11 @@ export declare class Cancellation {
|
|
|
30
30
|
/**
|
|
31
31
|
* The reason for cancellation.
|
|
32
32
|
*/
|
|
33
|
-
reason: unknown;
|
|
33
|
+
readonly reason: unknown;
|
|
34
34
|
/**
|
|
35
35
|
* The cancel token that triggered the cancellation.
|
|
36
36
|
*/
|
|
37
|
-
token: CancelToken;
|
|
37
|
+
readonly token: CancelToken | undefined;
|
|
38
38
|
constructor(reason?: unknown, token?: CancelToken);
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getLogger as i}from"../utilities/log.js";import{parallelEach as e}from"../utilities/promise.js";import{handles as t}from"./HandlesMixin.js";import{InitializeError as r}from"./InitializeError.js";import{SerializableBase as s}from"./Serializable.js";import{notifyChange as a,observable as o}from"./observableUtils.js";export class InitializableBase extends(t(o(s))){get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get failureMode(){return this._failureMode}set failureMode(i){this._failureMode=i}_isInitialized=!1;_isDestroyed=!1;_initializePromise;_destroyPromise;_failureMode="warn";async initialize(){return void 0===this._initializePromise&&(this._initializePromise=(async()=>{try{await this.finishAssignProperties(),await this._onInitialize(),await this._initializeChildren(),await this._postInitialize()}catch(i){throw i instanceof Error?(this._initializePromise=void 0,new r(this.failureMode,i,this)):i}this._isInitialized=!0,a(this,"isInitialized")})()),this._initializePromise}async destroy(){return void 0===this._destroyPromise&&(this._destroyPromise=(async()=>{try{await this._onDestroy(),super.destroy()}catch(i){throw this._destroyPromise=void 0,i}this._isDestroyed=!0,a(this,"isDestroyed")})()),this._destroyPromise}toJSON(i="all"){return super.toJSON(i)}assignProperties(i){super.assignProperties(i)}assignPropertiesAsync(i){return super.assignPropertiesAsync(i)}getDefaults(){return super.getDefaults()}getDefault(i){return super.getDefault(i)}getSerializableProperties(i){return super.getSerializableProperties(i)}_getSerializableProperties(){return{...super._getSerializableProperties(),failureMode:{serializeModes:["initial"],default:"warn"}}}async _onInitialize(){}async _postInitialize(){}async _onDestroy(){}async _initializeChildren(){await e(this._initializableChildCollections(),(i=>initializeCollection(i,{target:this,onInitializeWarning:i=>this.emit("initializeWarning",i)})))}*_initializableChildCollections(){}}const n=
|
|
1
|
+
import{getLogger as i}from"../utilities/log.js";import{parallelEach as e}from"../utilities/promise.js";import{handles as t}from"./HandlesMixin.js";import{InitializeError as r}from"./InitializeError.js";import{SerializableBase as s}from"./Serializable.js";import{notifyChange as a,observable as o}from"./observableUtils.js";export class InitializableBase extends(t(o(s))){get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get failureMode(){return this._failureMode}set failureMode(i){this._failureMode=i}_isInitialized=!1;_isDestroyed=!1;_initializePromise;_destroyPromise;_failureMode="warn";async initialize(){return void 0===this._initializePromise&&(this._initializePromise=(async()=>{try{await this.finishAssignProperties(),await this._onInitialize(),await this._initializeChildren(),await this._postInitialize()}catch(i){throw i instanceof Error?(this._initializePromise=void 0,new r(this.failureMode,i,this)):i}this._isInitialized=!0,a(this,"isInitialized")})()),this._initializePromise}async destroy(){return void 0===this._destroyPromise&&(this._destroyPromise=(async()=>{try{await this._onDestroy(),super.destroy()}catch(i){throw this._destroyPromise=void 0,i}this._isDestroyed=!0,a(this,"isDestroyed")})()),this._destroyPromise}toJSON(i="all"){return super.toJSON(i)}assignProperties(i){super.assignProperties(i)}assignPropertiesAsync(i){return super.assignPropertiesAsync(i)}getDefaults(){return super.getDefaults()}getDefault(i){return super.getDefault(i)}getSerializableProperties(i){return super.getSerializableProperties(i)}_getSerializableProperties(){return{...super._getSerializableProperties(),failureMode:{serializeModes:["initial"],default:"warn"}}}async _onInitialize(){}async _postInitialize(){}async _onDestroy(){}async _initializeChildren(){await e(this._initializableChildCollections(),(i=>initializeCollection(i,{target:this,onInitializeWarning:i=>this.emit("initializeWarning",i)})))}*_initializableChildCollections(){}}const n=()=>{};export async function initializeCollection(t,s){const{onInitializeWarning:a=n,target:o}=s??{};await e(t.toArray(),(async e=>{const t=e.on("initializeWarning",a);try{await e.initialize()}catch(t){const s=t instanceof r?t:new r(e.failureMode,t,e);if("error"===s.failureMode)throw s;"warn"===s.failureMode&&i("geocortex.api.support.InitializeBase").warn({message:"Error attempting to initialize child item: {0}.",error:s},s.error.message);const n={error:s,target:o};a?.(n)}finally{t.remove()}}))}
|
|
@@ -2,7 +2,7 @@ import { Evented } from "@arcgis/core/core/Evented.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* A class that can take in initial property values in its constructor.
|
|
4
4
|
*/
|
|
5
|
-
export type SerializableClass<P, T extends SerializableBase<P>> = new (properties
|
|
5
|
+
export type SerializableClass<P, T extends SerializableBase<P>> = new (properties: P, ...other: any[]) => T;
|
|
6
6
|
/**
|
|
7
7
|
* An object that can be serialized to/from plain JSON.
|
|
8
8
|
*/
|
|
@@ -178,6 +178,7 @@ export declare function shouldExcludeDefaults(mode: SerializeMode): boolean;
|
|
|
178
178
|
* serialized.
|
|
179
179
|
*/
|
|
180
180
|
export declare function filterJSONProperties<T, TContext extends object = object>(defs: PropertyDefs<T>, context: TContext, serializeMode: SerializeMode): T;
|
|
181
|
+
export declare function filterJSONProperties<T, TContext extends object = object>(defs: PropertyDefs<T>, context: TContext, serializeMode: "preferences"): T | undefined;
|
|
181
182
|
/**
|
|
182
183
|
* Sets properties on an object based on deserialization rules defined in
|
|
183
184
|
* property metadata.
|
|
@@ -223,7 +224,7 @@ export declare function isDefault(value: unknown): boolean;
|
|
|
223
224
|
*
|
|
224
225
|
* @param def The value to convert.
|
|
225
226
|
*/
|
|
226
|
-
export declare function toPropertyDef<T>(def: PropertyDef<T> | PropertyDefSerializeMode[] | PropertyDefSerializeMode): PropertyDef<T>;
|
|
227
|
+
export declare function toPropertyDef<T>(def: PropertyDef<T> | PropertyDefSerializeMode[] | PropertyDefSerializeMode | undefined): PropertyDef<T>;
|
|
227
228
|
/**
|
|
228
229
|
* Returns whether or not an object is serializable.
|
|
229
230
|
*
|
package/support/Serializable.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Evented as e}from"@arcgis/core/core/Evented.js";import t from"safe-stable-stringify";import{filter as r,isPlainObject as i,map as s,objectKeys as o}from"../utilities/object.js";const n=new WeakSet;export class SerializableBase extends e{_assignPropertiesPromises=[];constructor(e){if(super(),!n.has(this.constructor))throw new Error(`Class "${this.constructor.name}" must be marked as "@serializable" since it extends ${SerializableBase.name} (make sure it is the _last_ decorator on the class).`)}toJSON(e="all"){return filterJSONProperties(this._getSerializableProperties(),this,e)}assignProperties(e){const t=a(this._getSerializableProperties(),this,e,!0);this._assignPropertiesPromises.push(t),(async()=>{try{await t}finally{this._assignPropertiesPromises.splice(this._assignPropertiesPromises.indexOf(t),1)}})()}async assignPropertiesAsync(e){await this.finishAssignProperties();const t=assignPropertiesAsync(this._getSerializableProperties(),this,e);this._assignPropertiesPromises.push(t);try{await t}finally{this._assignPropertiesPromises.splice(this._assignPropertiesPromises.indexOf(t),1)}}async finishAssignProperties(){await Promise.all(this._assignPropertiesPromises)}getSerializableProperties(e="all"){return getSerializableProperties(this._getSerializableProperties(),e)}getDefaults(){return getDefaults(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}_getSerializableProperties(){return{}}_toPropertyDef(e){return toPropertyDef(e)}}export function serializable(e){if(!isSerializable(e.prototype))throw new Error(`Class "${e.name}" is marked as @serializable but does not implement 'Serializable'.`);class t extends e{constructor(e,...r){super(e,...r),this.constructor===t&&this.assignProperties({...this.getDefaults(),...e})}}return n.add(t),t}export function shouldExcludeDefaults(e){return"initial"===e||"project"===e}export function filterJSONProperties(e,r,i){let s=i;"initial"!==s&&"initial-with-defaults"!==s&&"preferences"!==s&&"project"!==s&&(s="all");const n={},a=getSerializableProperties(e,s);for(const e of o(a)){const i=a[e],o=l(e,i,r,s);if(shouldExcludeDefaults(s)){let r=!1;r=i.hasOwnProperty("default")?t(o)===t(i.default):i.isDefault?i.isDefault(o,s):isDefault(o),r||(n[e]=o)}else n[e]=o}if(!shouldExcludeDefaults(s)&&"preferences"!==s||!isDefault(n))return n}export function assignProperties(e,t,r){r&&a(e,t,r,!0)}export function assignPropertiesAsync(e,t,r){return a(e,t,r)}function a(e,t,r,s=!1){if(!r)return Promise.resolve();const o=[];return Object.keys(e).forEach((n=>{const a=e[n];if(r.hasOwnProperty(n)&&(Array.isArray(e[n])||!1!==a.deserialize))try{const e=r[n]??void 0;if(a?.deserialize){const t=a.deserialize(e);t&&o.push(t)}else"object"!=typeof t[n]||!t[n]||!i(e)&&void 0!==e||s||"function"!=typeof t[n].assignPropertiesAsync?"object"==typeof t[n]&&t[n]&&(i(e)||void 0===e)&&"function"==typeof t[n].assignProperties?t[n].assignProperties(e):t[n]=e:o.push(t[n].assignPropertiesAsync(e))}catch(e){if(s)throw e;o.push(Promise.reject(e))}})),Promise.all(o).then()}export function getDefaults(e){const t={},r=o(e).filter((t=>"object"==typeof e[t]));for(const i of r){const r=e[i];r.hasOwnProperty("default")&&(t[i]=r.default)}return t}export function getDefault(e,t){return getDefaults(e)[t]}export function isDefault(e){if(null==e)return!0;if(e.constructor===Object){if(!Object.keys(e).length)return!0}return!(!Array.isArray(e)||e.length)}function l(e,t,r,i){const s=t?.serialize?t.serialize(i):r[e];if(s&&"function"==typeof s.toItemUri)return s.toItemUri();if(s&&"function"==typeof s.toJSON)return s.toJSON(i);if(Array.isArray(s))return s.map(((e,t)=>l(t,void 0,s,i)));if(s&&"function"==typeof s.toArray){const e=s.toArray();return e.map(((t,r)=>l(r,void 0,e,i)))}if(s&&"object"==typeof s){const e={};for(const t of Object.keys(s))e[t]=l(t,void 0,s,i);return e}return t?.serialize?s:r[e]}export function toPropertyDef(e){const t={serializeModes:[]};return"string"==typeof e?{...t,serializeModes:[e]}:Array.isArray(e)?{...t,serializeModes:e}:{...t,...e}}export function isSerializable(e){return["assignProperties","getDefaults","getSerializableProperties","toJSON"].every((t=>"function"==typeof e[t]))}export function getSerializableProperties(e,t="all"){const i=s(e,(e=>toPropertyDef(e))),o=r(i,(e
|
|
1
|
+
import{Evented as e}from"@arcgis/core/core/Evented.js";import t from"safe-stable-stringify";import{filter as r,isPlainObject as i,map as s,objectKeys as o}from"../utilities/object.js";const n=new WeakSet;export class SerializableBase extends e{_assignPropertiesPromises=[];constructor(e){if(super(),!n.has(this.constructor))throw new Error(`Class "${this.constructor.name}" must be marked as "@serializable" since it extends ${SerializableBase.name} (make sure it is the _last_ decorator on the class).`)}toJSON(e="all"){return filterJSONProperties(this._getSerializableProperties(),this,e)}assignProperties(e){const t=a(this._getSerializableProperties(),this,e,!0);this._assignPropertiesPromises.push(t),(async()=>{try{await t}finally{this._assignPropertiesPromises.splice(this._assignPropertiesPromises.indexOf(t),1)}})()}async assignPropertiesAsync(e){await this.finishAssignProperties();const t=assignPropertiesAsync(this._getSerializableProperties(),this,e);this._assignPropertiesPromises.push(t);try{await t}finally{this._assignPropertiesPromises.splice(this._assignPropertiesPromises.indexOf(t),1)}}async finishAssignProperties(){await Promise.all(this._assignPropertiesPromises)}getSerializableProperties(e="all"){return getSerializableProperties(this._getSerializableProperties(),e)}getDefaults(){return getDefaults(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}_getSerializableProperties(){return{}}_toPropertyDef(e){return toPropertyDef(e)}}export function serializable(e){if(!isSerializable(e.prototype))throw new Error(`Class "${e.name}" is marked as @serializable but does not implement 'Serializable'.`);class t extends e{constructor(e,...r){super(e,...r),this.constructor===t&&this.assignProperties({...this.getDefaults(),...e})}}return n.add(t),t}export function shouldExcludeDefaults(e){return"initial"===e||"project"===e}export function filterJSONProperties(e,r,i){let s=i;"initial"!==s&&"initial-with-defaults"!==s&&"preferences"!==s&&"project"!==s&&(s="all");const n={},a=getSerializableProperties(e,s);for(const e of o(a)){const i=a[e],o=l(e,i,r,s);if(shouldExcludeDefaults(s)){let r=!1;r=i.hasOwnProperty("default")?t(o)===t(i.default):i.isDefault?i.isDefault(o,s):isDefault(o),r||(n[e]=o)}else n[e]=o}if(!shouldExcludeDefaults(s)&&"preferences"!==s||!isDefault(n))return n}export function assignProperties(e,t,r){r&&a(e,t,r,!0)}export function assignPropertiesAsync(e,t,r){return a(e,t,r)}function a(e,t,r,s=!1){if(!r)return Promise.resolve();const o=[];return Object.keys(e).forEach((n=>{const a=e[n];if(r.hasOwnProperty(n)&&(Array.isArray(e[n])||!1!==a.deserialize))try{const e=r[n]??void 0;if(a?.deserialize){const t=a.deserialize(e);t&&o.push(t)}else"object"!=typeof t[n]||!t[n]||!i(e)&&void 0!==e||s||"function"!=typeof t[n].assignPropertiesAsync?"object"==typeof t[n]&&t[n]&&(i(e)||void 0===e)&&"function"==typeof t[n].assignProperties?t[n].assignProperties(e):t[n]=e:o.push(t[n].assignPropertiesAsync(e))}catch(e){if(s)throw e;o.push(Promise.reject(e))}})),Promise.all(o).then()}export function getDefaults(e){const t={},r=o(e).filter((t=>"object"==typeof e[t]));for(const i of r){const r=e[i];r.hasOwnProperty("default")&&(t[i]=r.default)}return t}export function getDefault(e,t){return getDefaults(e)[t]}export function isDefault(e){if(null==e)return!0;if(e.constructor===Object){if(!Object.keys(e).length)return!0}return!(!Array.isArray(e)||e.length)}function l(e,t,r,i){const s=t?.serialize?t.serialize(i):r[e];if(s&&"function"==typeof s.toItemUri)return s.toItemUri();if(s&&"function"==typeof s.toJSON)return s.toJSON(i);if(Array.isArray(s))return s.map(((e,t)=>l(t,void 0,s,i)));if(s&&"function"==typeof s.toArray){const e=s.toArray();return e.map(((t,r)=>l(r,void 0,e,i)))}if(s&&"object"==typeof s){const e={};for(const t of Object.keys(s))e[t]=l(t,void 0,s,i);return e}return t?.serialize?s:r[e]}export function toPropertyDef(e){const t={serializeModes:[]};return"string"==typeof e?{...t,serializeModes:[e]}:Array.isArray(e)?{...t,serializeModes:e}:{...t,...e}}export function isSerializable(e){return["assignProperties","getDefaults","getSerializableProperties","toJSON"].every((t=>"function"==typeof e[t]))}export function getSerializableProperties(e,t="all"){const i=s(e,(e=>toPropertyDef(e))),o=r(i,(e=>!!e&&function(e,t){if(!1===t.serialize)return!1;const r="initial-with-defaults"===e?"initial":e;return"all"===e||!0===t.serializeModes?.includes(r)}(t,e)));return o}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@arcgis/core/core/Collection";import{RelationshipCollection as i}from"../data/FeatureSourceBase.js";import{ArcGISRelationship as r}from"../tasks/query/ArcGISRelationship.js";import{map as t}from"../utilities/promise.js";import{DefaultArcGISRequestHelper as s}from"./ArcGISRequestHelper.js";export class ArcGISRelationshipCollection extends i{_unresolvedRelationships=new e;_requestHelper;_initializePromise;get requestHelper(){return this._requestHelper||(this._requestHelper=this._source.requestHelper??new s),this._requestHelper}set requestHelper(e){this._requestHelper=e}async initialize(){return void 0===this._initializePromise&&(this._initializePromise=(async()=>{if(!this._sourceUrl)return;const e=await this.requestHelper.request(this._sourceUrl,{query:{f:"json"}});e?.data?.relationships&&await t(e.data.relationships,(async e=>{const i=`${this._sourceUrl.slice(0,this._sourceUrl.length-`${this._sourceLayerId}`.length-1)}/${e.relatedTableId}`,r=await this.requestHelper.request(i,{query:{f:"json"}});if(!r?.data||!Array.isArray(r?.data.relationships))return;const t=r.data.relationships.find((e=>e.relatedTableId===this._sourceLayerId));let s="many-to-many";switch(e.cardinality){case"esriRelCardinalityOneToOne":s="one-to-one";break;case"esriRelCardinalityOneToMany":s="esriRelRoleOrigin"===e.role?"one-to-many":"many-to-one";break;case"esriRelCardinalityManyToMany":s="many-to-many";break;default:throw new Error(`Unknown cardinality value "${e.cardinality}".`)}this._unresolvedRelationships.add({$relationshipType:"ArcGISRelationship",id:`${e.id}`,title:e.name,keyField:e.keyField,relatedKeyField:t?.keyField,
|
|
1
|
+
import e from"@arcgis/core/core/Collection";import{RelationshipCollection as i}from"../data/FeatureSourceBase.js";import{ArcGISRelationship as r}from"../tasks/query/ArcGISRelationship.js";import{map as t}from"../utilities/promise.js";import{DefaultArcGISRequestHelper as s}from"./ArcGISRequestHelper.js";export class ArcGISRelationshipCollection extends i{_unresolvedRelationships=new e;_requestHelper;_initializePromise;get requestHelper(){return this._requestHelper||(this._requestHelper=this._source.requestHelper??new s),this._requestHelper}set requestHelper(e){this._requestHelper=e}async initialize(){return void 0===this._initializePromise&&(this._initializePromise=(async()=>{if(!this._sourceUrl)return;const e=await this.requestHelper.request(this._sourceUrl,{query:{f:"json"}});e?.data?.relationships&&await t(e.data.relationships,(async e=>{const i=`${this._sourceUrl.slice(0,this._sourceUrl.length-`${this._sourceLayerId}`.length-1)}/${e.relatedTableId}`,r=await this.requestHelper.request(i,{query:{f:"json"}});if(!r?.data||!Array.isArray(r?.data.relationships))return;const t=r.data.relationships.find((e=>e.relatedTableId===this._sourceLayerId));let s="many-to-many";switch(e.cardinality){case"esriRelCardinalityOneToOne":s="one-to-one";break;case"esriRelCardinalityOneToMany":s="esriRelRoleOrigin"===e.role?"one-to-many":"many-to-one";break;case"esriRelCardinalityManyToMany":s="many-to-many";break;default:throw new Error(`Unknown cardinality value "${e.cardinality}".`)}this._unresolvedRelationships.add({$relationshipType:"ArcGISRelationship",id:`${e.id}`,title:e.name,keyField:e.keyField,relatedKeyField:t?.keyField,relatedLayerId:e.relatedTableId,cardinality:s,relationshipTableId:e.relationshipTableId,originForeignKey:e.keyFieldInRelationshipTable,destinationForeignKey:t?.keyFieldInRelationshipTable})}))})()),this._initializePromise}get _collection(){const e=this._unresolvedRelationships.toArray();this._unresolvedRelationships.removeAll();for(const i of e)this._resolveRelationship(i)||this._unresolvedRelationships.add(i);return this._collectionField}_resolveRelationship(e){const i=this._findRelatedSource(e.relatedLayerId);return!!i&&(this.add(new r({...e,relatedSource:i})),!0)}}
|
package/support/_featureEdit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FeatureSaveError as e}from"../data/FeatureSaveError.js";import{getGlobalIdField as t,getReturnServiceEditsOption as s,isGlobalIdUsed as r}from"../mapping/support/layers.js";import{isFeatureLayer as l,isSubtypeGroupLayer as n}from"../utilities/_layers.js";import{cancelify as o}from"./Cancellable.js";export async function applyEdits(a,
|
|
1
|
+
import{FeatureSaveError as e}from"../data/FeatureSaveError.js";import{getGlobalIdField as t,getReturnServiceEditsOption as s,isGlobalIdUsed as r}from"../mapping/support/layers.js";import{isFeatureLayer as l,isSubtypeGroupLayer as n}from"../utilities/_layers.js";import{cancelify as o}from"./Cancellable.js";export async function applyEdits(u,a,i){const d={addFeatures:[],updateFeatures:[],deleteFeatures:[]},{adds:c=[],updates:p=[],deletes:f=[]}=u,y=[],m=[],h=[],g=l(a)||n(a)?t(a):void 0,{objectIdField:F}=a;for(const e of c)d.addFeatures.push(e.toGraphic()),y.push(e);for(const e of p){const t=e.toGraphic();e.source?.schema.fieldExtensions.forEach((e=>{e.field.editable||e.field.name===F||e.field.name===g||delete t.attributes[e.field.name]})),d.updateFeatures.push(t),m.push(e)}for(const e of f)"string"==typeof e?(d.deleteFeatures.push({objectId:e}),h.push({primaryKey:e})):(d.deleteFeatures.push(e.toGraphic()),h.push(e));if(0===y.length&&0===m.length&&0===h.length)return;const b=l(a)||n(a)?r(a,d):void 0,E=a.applyEdits(d,{globalIdUsed:b,returnServiceEditsOption:s(a)}),R=await o(E,i?.cancelToken);if(null==R||(R.addFeatureResults?.length??0)!==y.length||(R.updateFeatureResults?.length??0)!==m.length||(R.deleteFeatureResults?.length??0)!==h.length)throw new e("Received malformed response from server while saving feature(s).");const w=new e("Errors encountered when editing features.");if(applyEditsProcessResults(a,y,R.addFeatureResults,"add",w),applyEditsProcessResults(a,m,R.updateFeatureResults,"update",w),applyEditsProcessResults(a,h,R.deleteFeatureResults,"delete",w),null!=R.editedFeatureResults&&function(e,t,s){if(null==t.adds&&null==t.updates)return;for(const r of s)r.layerId===e.layerId&&applyEditsProcessEditedFeatures(e,t,r.editedFeatures)}(a,{adds:y,updates:m},R.editedFeatureResults),w.errors.size>0)throw w}export function applyEditsProcessResults(e,s,r,o,u){if(null!=r&&null!=s)for(const[a,i]of r.entries()){const r=s[a];if(null!=r)if(null==i.error){if("add"===o&&"schema"in r){const{primaryKeyField:s}=r.schema;if(null!=s&&r.attributes.set(s,i.objectId),l(e)||n(e)){const{globalId:s}=i;if(null!=s){const l=t(e);null!=l&&r.attributes.set(l,s)}}}}else{const{primaryKey:e}=r,t="title"in r?r.title:"";u.errors.set(e??`${t}-${a}`,new Error(`Failed to ${o} feature '${t}' with id ${e}. ${i.error.name} : ${i.error.message}`))}}}export function applyEditsProcessEditedFeatures(e,t,s){const r=(t,s)=>{const r=t.getAttribute(e.objectIdField);null!=r&&s.set(r.toString(),t)};if(null!=s.adds&&null!=t.adds){const e=s.adds.reduce(((e,t)=>(r(t,e),e)),new Map);for(const s of t.adds){if(null==s.primaryKey)continue;const t=e.get(s.primaryKey);null!=t&&u(s,t)}}if(null!=s.updates&&null!=t.updates){const e=s.updates.reduce(((e,t)=>{if(null==t.current)return e;if(Array.isArray(t.current))for(const s of t.current)r(s,e);else{const s=t.current;r(s,e)}return e}),new Map);for(const s of t.updates){if(null==s.primaryKey)continue;const t=e.get(s.primaryKey);null!=t&&u(s,t)}}}function u(e,t){for(const[s,r]of Object.entries(t.attributes))e.attributes.get(s)!==r&&e.attributes.set(s,r);null!=t.geometry&&(e.geometry=t.geometry.clone())}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@arcgis/core/core/Collection";import{QueryOptions as s}from"../tasks/query/QueryOptions.js";import{checkArg as i}from"../utilities/checkArg.js";import{count as t,query as o}from"../utilities/query.js";import{cancelify as r}from"./Cancellable.js";export function executeQuery(t,l,a,c){i("where",t).isNotMissing(),i("source",l).isNotMissing(),i("queryable",a).isNotMissing();const n={...s.DEFAULTS,...s.fromFeatureSource(l),...c};return i("options.maxResults",n.maxResults).satisfies((e=>null==e||e>0)),async function*(){let s;if(e.isCollection(a)||Array.isArray(a))s=e.isCollection(a)?a.toArray():a.slice();else{s=(await a).features,s.forEach((e=>e.popupTemplate=e.getEffectivePopupTemplate())),s=s.slice()}const i=r(o(t,l,s,n),n.cancelToken);let c=await i;c=c.slice(0,n.maxResults||c.length),yield*c}()}export async function executeCount(o,l,a,c){i("where",o).isNotMissing(),i("source",l).isNotMissing(),i("queryable",a).isNotMissing();const n={...s.DEFAULTS,...s.fromFeatureSource(l),...c},{maxResults:u,cancelToken:f}=n;let m;if(i("options.maxResults",u).satisfies((e=>null==e||e>0)),e.isCollection(a)||Array.isArray(a))m=e.isCollection(a)?a.toArray():a.slice();else{m=(await a).features.slice()}let p=await r(t(o,m,n),f);return u
|
|
1
|
+
import e from"@arcgis/core/core/Collection";import{QueryOptions as s}from"../tasks/query/QueryOptions.js";import{checkArg as i}from"../utilities/checkArg.js";import{count as t,query as o}from"../utilities/query.js";import{cancelify as r}from"./Cancellable.js";export function executeQuery(t,l,a,c){i("where",t).isNotMissing(),i("source",l).isNotMissing(),i("queryable",a).isNotMissing();const n={...s.DEFAULTS,...s.fromFeatureSource(l),...c};return i("options.maxResults",n.maxResults).satisfies((e=>null==e||e>0)),async function*(){let s;if(e.isCollection(a)||Array.isArray(a))s=e.isCollection(a)?a.toArray():a.slice();else{s=(await a).features,s.forEach((e=>e.popupTemplate=e.getEffectivePopupTemplate())),s=s.slice()}const i=r(o(t,l,s,n),n.cancelToken);let c=await i;c=c.slice(0,n.maxResults||c.length),yield*c}()}export async function executeCount(o,l,a,c){i("where",o).isNotMissing(),i("source",l).isNotMissing(),i("queryable",a).isNotMissing();const n={...s.DEFAULTS,...s.fromFeatureSource(l),...c},{maxResults:u,cancelToken:f}=n;let m;if(i("options.maxResults",u).satisfies((e=>null==e||e>0)),e.isCollection(a)||Array.isArray(a))m=e.isCollection(a)?a.toArray():a.slice();else{m=(await a).features.slice()}let p=await r(t(o,m,n),f);return u&&p>u&&(p=u),{source:l,count:p}}
|
package/support/_query.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isLayerExtension as e,isSublayerExtension as t}from"../ItemType.js";import{toFeature as n}from"../data/Feature.js";import{isTimeAwareLayer as i}from"../utilities/_layers.js";import{checkArg as s}from"../utilities/checkArg.js";import{cancelifyWithAbortSignal as r}from"./Cancellable.js";export function concatenateWhereClauses(e,t){return
|
|
1
|
+
import{isLayerExtension as e,isSublayerExtension as t}from"../ItemType.js";import{toFeature as n}from"../data/Feature.js";import{isTimeAwareLayer as i}from"../utilities/_layers.js";import{checkArg as s}from"../utilities/checkArg.js";import{cancelifyWithAbortSignal as r}from"./Cancellable.js";export function concatenateWhereClauses(e,t){return(e?.length&&t?.length?`(${e}) and (${t})`:e||t)??void 0}export function executeQuery(e,t,i,o){return s("query",e).isNotMissing(),s("source",t).isNotMissing(),s("queryable",i).isNotMissing(),e.where=concatenateWhereClauses(i.definitionExpression,e.where),"function"!=typeof t&&constrainQueryTimeExtentToView(e,t),async function*(){const s=e.num;let a=(await r((async t=>i.queryFeatures(e,{signal:t})),o)).features;s&&a.length>s&&(a=a.slice(0,s)),yield*a.map((e=>n(e,{source:"function"==typeof t?t(e):t})))}()}export async function executeCount(e,t,n,i){s("query",e).isNotMissing(),s("source",t).isNotMissing(),s("queryable",n).isNotMissing(),e.where=concatenateWhereClauses(n.definitionExpression,e.where),constrainQueryTimeExtentToView(e,t);const o=e.num;e.num=void 0;let a=await r((async t=>n.queryFeatureCount(e,{signal:t})),i);return o&&a>o&&(a=o),{source:t,count:a}}export async function executeCountByQuery(e,t,n,i){s("query",e).isNotMissing(),s("source",t).isNotMissing(),s("queryable",n).isNotMissing(),e.where=concatenateWhereClauses(n.definitionExpression,e.where),constrainQueryTimeExtentToView(e,t);const o=e.num;let a=(await r((async t=>n.queryFeatures(e,{signal:t})),i)).features.length;return o&&a>o&&(a=o),{source:t,count:a}}export function constrainQueryTimeExtentToView(n,s){let r;if(e(s)?r=s:t(s)&&(r=s.layerExtension),!i(r?.layer))return;const{layer:o,mapExtension:a}=r,u=a?._allLayerViews.find((e=>e.layer===o))?.view?.timeExtent;if(n.timeExtent||(n.timeExtent=o.timeExtent?.clone()),o.useViewTime&&u)if(n.timeExtent){const e=[];n.timeExtent.start&&e.push(n.timeExtent.start.valueOf()),u.start&&e.push(u.start.valueOf());const t=[];n.timeExtent.end&&t.push(n.timeExtent.end.valueOf()),u.end&&t.push(u.end.valueOf()),n.timeExtent.start=e.length?new Date(Math.max(...e)):void 0,n.timeExtent.end=t.length?new Date(Math.min(...t)):void 0}else n.timeExtent=u?.clone()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCountByQuery as r}from"../../support/_query.js";import{empty as t}from"../../utilities/asyncIterable.js";import{isMapImageSublayer as s}from"../../utilities/layers.js";import{IdentifyProviderBase as u}from"./IdentifyProviderBase.js";export class ArcGISSublayerQueryIdentifyProvider extends u{isSupported(e,r,t){return s(e.sublayer)&&e.capabilities.supportsQuery}_identify(r,s,u){const o=r,a=o.sublayer.createQuery();return o.capabilities.supportsQuery?(a.geometry=s,a.outFields=u.outFields??r.featureSettings.outFields,a.returnGeometry=u.returnGeometry,a.outSpatialReference=u.outSpatialReference,a.maxAllowableOffset=u.maxAllowableOffset,a.returnZ=o.sublayer.layer
|
|
1
|
+
import{executeQuery as e,executeCountByQuery as r}from"../../support/_query.js";import{empty as t}from"../../utilities/asyncIterable.js";import{isMapImageSublayer as s}from"../../utilities/layers.js";import{IdentifyProviderBase as u}from"./IdentifyProviderBase.js";export class ArcGISSublayerQueryIdentifyProvider extends u{isSupported(e,r,t){return s(e.sublayer)&&e.capabilities.supportsQuery}_identify(r,s,u){const o=r,a=o.sublayer.createQuery();return o.capabilities.supportsQuery?(a.geometry=s,a.outFields=u.outFields??r.featureSettings.outFields,a.returnGeometry=u.returnGeometry??a.returnGeometry,a.outSpatialReference=u.outSpatialReference,a.maxAllowableOffset=u.maxAllowableOffset,a.returnZ=o.sublayer.layer?.sourceJSON?.hasZ,r.supportsPagination&&(a.num=u.maxResults),e(a,o,o.sublayer,u.cancelToken)):t()}async _count(e,t,s){const u=e;if(!u.capabilities.supportsQuery)return{source:e,count:0};const o=u.sublayer.createQuery();return o.geometry=t,o.num=s.maxResults,o.returnGeometry=s.returnGeometry??o.returnGeometry,o.outFields=s.outFields??e.featureSettings.outFields,r(o,u,u.sublayer,s.cancelToken)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toFeature as e}from"../../data/Feature.js";import{cancelifyWithAbortSignal as t}from"../../support/Cancellable.js";import{executeQuery as r,executeCount as
|
|
1
|
+
import{toFeature as e}from"../../data/Feature.js";import{cancelifyWithAbortSignal as t}from"../../support/Cancellable.js";import{executeQuery as r,executeCount as o}from"../../support/_query.js";import{isCSVLayerExtension as n}from"../../utilities/extensions.js";import{removeZValues as a}from"../../utilities/geometry.js";import{IdentifyProviderBase as i}from"./IdentifyProviderBase.js";import{hitTestForClusterFeatures as s}from"./_utilities.js";async function u(e,r,o,n){const a=await s(e,r);if(0===a.length)return[];const i=[];for(const e of a){const t=e.getObjectId();null!=t&&i.push(t)}n.aggregateIds=i;const u=await t((t=>e._layerView.queryFeatures(n,{signal:t})),o.cancelToken);return u?.features}export class CSVLayerClientSideQueryIdentifyProvider extends i{isSupported(e,t,r){return n(e)&&!!e.layer}_identify(t,o,n,i){return async function*(){const s=t,l=s.layer.createQuery();if(l.outFields=n.outFields??t.featureSettings.outFields,l.returnGeometry=n.returnGeometry??l.returnGeometry,l.outSpatialReference=n.outSpatialReference,l.maxAllowableOffset=n.maxAllowableOffset,l.num=n.maxResults,l.returnZ="scene"===s.mapExtension?.viewMode,"cluster"===s?.layer?.featureReduction?.type&&"point"===i){const r=await u(s,o,n,l);if(r?.length>0)return void(yield*r.map((r=>e(r,{source:t}))))}let c=o;c&&!s.layer.capabilities?.data?.supportsZ&&(c=a(c.clone())),l.geometry=c,yield*r(l,s,s.layer,n.cancelToken)}()}async _count(e,t,r,n){const i=e,s=i.layer.createQuery();if(s.num=r.maxResults,s.returnGeometry=r.returnGeometry??s.returnGeometry,s.outFields=r.outFields??e.featureSettings.outFields,"cluster"===i?.layer?.featureReduction?.type&&"point"===n){const e=await u(i,t,r,s);if(e?.length>0)return{source:i,count:e.length}}if(!s.aggregateIds){let e=t;e&&!i.layer.capabilities?.data?.supportsZ&&(e=a(e.clone())),s.geometry=e}return o(s,i,i.layer,r.cancelToken)}}
|
|
@@ -44,6 +44,6 @@ export declare abstract class ClientSideIdentifyProvider extends IdentifyProvide
|
|
|
44
44
|
* @param options Options for the query.
|
|
45
45
|
* @param aggregateIds The ObjectIds of cluster features to query with.
|
|
46
46
|
*/
|
|
47
|
-
protected _createQuery(source: ClientSideIdentifiableLayerExtension | ClientSideQueryableSublayerExtension, geometry: Geometry | undefined, options: IdentifyOptions, aggregateIds?: (string | number
|
|
47
|
+
protected _createQuery(source: ClientSideIdentifiableLayerExtension | ClientSideQueryableSublayerExtension, geometry: Geometry | undefined, options: IdentifyOptions, aggregateIds?: (string | number)[]): Query;
|
|
48
48
|
protected _getClientSideLayerGraphics(source: ClientSideIdentifiableLayerExtension | ClientSideQueryableSublayerExtension, geometry: Geometry, options: IdentifyOptions, geometryType?: string): Promise<Graphic[] | undefined>;
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toFeature as e}from"../../data/Feature.js";import{cancelifyWithAbortSignal as t}from"../../support/Cancellable.js";import*as r from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as i}from"../../utilities/extensions.js";import{isBuildingComponentSublayer as s}from"../../utilities/layers.js";import{IdentifyProviderBase as a}from"./IdentifyProviderBase.js";export class ClientSideIdentifyProvider extends a{_identify(t,i,s,a){const n=this;return async function*(){const o=await n._getClientSideLayerGraphics(t,i,s,a);o?.length?yield*o.map((r=>e(r,{source:t}))):yield*r.empty()}()}async _count(e,t,r,i){const s=await this._getClientSideLayerGraphics(e,t,r,i);return{source:e,count:s?s.length:0}}_createQuery(e,t,r,a){const n=i(e)?e.layerExtension:e,{_layerView:o,featureSettings:l}=n,u=s(n.sublayer)?e.layerExtension?.mapExtension:e.mapExtension,c=o.createQuery();return c.geometry=t,c.outFields=r.outFields||l.outFields,c.returnGeometry=r.returnGeometry,c.outSpatialReference=r.outSpatialReference,c.maxAllowableOffset=r.maxAllowableOffset,c.num=r.maxResults,c.returnZ="scene"===u?.viewMode,c.aggregateIds=a,c}async _getClientSideLayerGraphics(e,r,s,a){const n=i(e)?e.layerExtension:e,{_layerView:o}=n;if(!o)return;const l=await t((async t=>o.queryFeatures(this._createQuery(e,r,s),{signal:t})),s.cancelToken);return l?.features}}
|
|
1
|
+
import{toFeature as e}from"../../data/Feature.js";import{cancelifyWithAbortSignal as t}from"../../support/Cancellable.js";import*as r from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as i}from"../../utilities/extensions.js";import{isBuildingComponentSublayer as s}from"../../utilities/layers.js";import{IdentifyProviderBase as a}from"./IdentifyProviderBase.js";export class ClientSideIdentifyProvider extends a{_identify(t,i,s,a){const n=this;return async function*(){const o=await n._getClientSideLayerGraphics(t,i,s,a);o?.length?yield*o.map((r=>e(r,{source:t}))):yield*r.empty()}()}async _count(e,t,r,i){const s=await this._getClientSideLayerGraphics(e,t,r,i);return{source:e,count:s?s.length:0}}_createQuery(e,t,r,a){const n=i(e)?e.layerExtension:e,{_layerView:o,featureSettings:l}=n,u=s(n.sublayer)?e.layerExtension?.mapExtension:e.mapExtension,c=o.createQuery();return c.geometry=t,c.outFields=r.outFields||l.outFields,c.returnGeometry=r.returnGeometry??c.returnGeometry,c.outSpatialReference=r.outSpatialReference,c.maxAllowableOffset=r.maxAllowableOffset,c.num=r.maxResults,c.returnZ="scene"===u?.viewMode,c.aggregateIds=a,c}async _getClientSideLayerGraphics(e,r,s,a){const n=i(e)?e.layerExtension:e,{_layerView:o}=n;if(!o)return;const l=await t((async t=>o.queryFeatures(this._createQuery(e,r,s),{signal:t})),s.cancelToken);return l?.features}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cancelifyWithAbortSignal as e}from"../../support/Cancellable.js";import{isPoint as t}from"../../utilities/esri.js";import{isFeatureLayer as i}from"../../utilities/layers.js";import{ClientSideIdentifyProvider as r}from"./ClientSideIdentifyProvider.js";import{hitTestForClusterFeatures as a}from"./_utilities.js";export class FeatureLayerClientSideIdentifyProvider extends r{isSupported(e,r,a){return i(e.layer)&&e.enableClientSideData&&r&&!!e._layerView?.view?.extent?.intersects(t(r)?r:r.extent)&&0!==e._layerView.availableFields.length&&(a?.outFields??e.featureSettings.outFields).every((t=>e._layerView.availableFields.includes(t)))}async _getClientSideLayerGraphics(t,i,r,
|
|
1
|
+
import{cancelifyWithAbortSignal as e}from"../../support/Cancellable.js";import{isPoint as t}from"../../utilities/esri.js";import{isFeatureLayer as i}from"../../utilities/layers.js";import{ClientSideIdentifyProvider as r}from"./ClientSideIdentifyProvider.js";import{hitTestForClusterFeatures as a}from"./_utilities.js";export class FeatureLayerClientSideIdentifyProvider extends r{isSupported(e,r,a){return i(e.layer)&&e.enableClientSideData&&r&&!!e._layerView?.view?.extent?.intersects(t(r)?r:r.extent)&&0!==e._layerView.availableFields.length&&(a?.outFields??e.featureSettings.outFields).every((t=>e._layerView.availableFields.includes(t)))}async _getClientSideLayerGraphics(t,i,r,s){let l=[];if("cluster"===t.layer?.featureReduction?.type&&"point"===s&&(l=await a(t,i)),l.length>0){const{_layerView:i}=t,a=await e((async e=>{const a=[];for(const e of l){const t=e.getObjectId();null!=t&&a.push(t)}return i.queryFeatures(super._createQuery(t,void 0,r,a))}),r.cancelToken);if(a?.features.length>0)return a.features}return super._getClientSideLayerGraphics(t,i,r)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as
|
|
1
|
+
import{executeQuery as e,executeCount as r}from"../../support/_query.js";import{isFeatureCollectionLayerExtension as t,isFeatureLayerExtension as o}from"../../utilities/extensions.js";import{removeZValues as s}from"../../utilities/geometry.js";import{isFeatureLayer as a}from"../../utilities/layers.js";import{IdentifyProviderBase as i}from"./IdentifyProviderBase.js";export class FeatureLayerQueryIdentifyProvider extends i{isSupported(e,r,s){return(o(e)||t(e))&&a(e.layer)}_identify(r,t,o){const s=r,a=s.layer.createQuery(),i=t;return a.geometry=i,a.outFields=o.outFields??r.featureSettings.outFields,a.returnGeometry=o.returnGeometry??a.returnGeometry,a.outSpatialReference=o.outSpatialReference,a.maxAllowableOffset=o.maxAllowableOffset,s.layer.capabilities.query.supportsPagination&&(a.num=o.maxResults),a.returnZ=s.layer.hasZ,e(a,s,s.layer,o.cancelToken)}_count(e,t,o){const a=e,i=a.layer.createQuery();let u=t;return!u||a.layer.hasZ&&a.layer.capabilities?.data?.supportsZ||(u=s(u.clone())),i.geometry=u,i.num=o.maxResults,i.returnGeometry=o.returnGeometry??i.returnGeometry,i.outFields=o.outFields??e.featureSettings.outFields,r(i,a,a.layer,o.cancelToken)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toFeature as e}from"../../data/Feature.js";import{cancelifyWithAbortSignal as t}from"../../support/Cancellable.js";import{executeQuery as r,executeCount as
|
|
1
|
+
import{toFeature as e}from"../../data/Feature.js";import{cancelifyWithAbortSignal as t}from"../../support/Cancellable.js";import{executeQuery as r,executeCount as o}from"../../support/_query.js";import{isGeoJSONLayerExtension as a}from"../../utilities/extensions.js";import{removeZValues as n}from"../../utilities/geometry.js";import{IdentifyProviderBase as i}from"./IdentifyProviderBase.js";import{hitTestForClusterFeatures as s}from"./_utilities.js";async function u(e,r,o,a){const n=await s(e,r);if(0===n.length)return[];const i=[];for(const e of n){const t=e.getObjectId();null!=t&&i.push(t)}a.aggregateIds=i;const u=await t((t=>e._layerView.queryFeatures(a,{signal:t})),o.cancelToken);return u?.features}export class GeoJSONLayerClientSideQueryIdentifyProvider extends i{isSupported(e,t,r){return a(e)&&!!e.layer}_identify(t,o,a,i){return async function*(){const s=t,l=s.layer.createQuery();if(l.outFields=a.outFields??t.featureSettings.outFields,l.returnGeometry=a.returnGeometry??l.returnGeometry,l.outSpatialReference=a.outSpatialReference,l.maxAllowableOffset=a.maxAllowableOffset,l.num=a.maxResults,l.returnZ=s.layer.hasZ,"cluster"===s?.layer?.featureReduction?.type&&"point"===i){const r=await u(s,o,a,l);if(r?.length>0)return void(yield*r.map((r=>e(r,{source:t}))))}let c=o;c&&!s.layer.capabilities?.data?.supportsZ&&(c=n(c.clone())),l.geometry=c,yield*r(l,s,s.layer,a.cancelToken)}()}async _count(e,t,r,a){const i=e,s=i.layer.createQuery();if(s.num=r.maxResults,s.returnGeometry=r.returnGeometry??s.returnGeometry,s.outFields=r.outFields??e.featureSettings.outFields,"cluster"===i?.layer?.featureReduction?.type&&"point"===a){const e=await u(i,t,r,s);if(e?.length>0)return{source:i,count:e.length}}if(!s.aggregateIds){let e=t;e&&!i.layer.capabilities?.data?.supportsZ&&(e=n(e.clone())),s.geometry=e}return o(s,i,i.layer,r.cancelToken)}}
|
|
@@ -26,7 +26,7 @@ export declare abstract class HitTestIdentifyProvider extends IdentifyProviderBa
|
|
|
26
26
|
* The query provider to fall back on, used to fetch attribute data that is
|
|
27
27
|
* not included within the map's graphics.
|
|
28
28
|
*/
|
|
29
|
-
queryProvider: QueryProvider;
|
|
29
|
+
queryProvider: QueryProvider | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* @inheritDoc
|
|
32
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{toFeature as e}from"../../data/Feature.js";import*as t from"../../utilities/asyncIterable.js";import{isPoint as r}from"../../utilities/esri.js";import{isCSVLayerExtension as i,isFeatureLayerExtension as s,isPointCloudLayerExtension as n,isSceneLayerExtension as o}from"../../utilities/extensions.js";import{isBuildingComponentSublayer as a}from"../../utilities/layers.js";import{caseInsensitiveEquals as u}from"../../utilities/string.js";import{IdentifyProviderBase as y}from"./IdentifyProviderBase.js";export class HitTestIdentifyProvider extends y{queryProvider;isSupported(e,t,r){return"point"===t?.type||!this._supportsQuery(e)}_identify(r,a,y){const p=this,c={...y};return async function*(){const y=await l(r,a),d=i(m=r)||s(m)||n(m)||o(m)?r.layer:r.sublayer;var m,f;if(y?.length){const t="point-cloud"===d.type?void 0:d.objectIdField;if(p.queryProvider&&p._supportsQuery(r)&&t&&(f=y[0],!r.featureSettings.outFields.every((e=>f.attributes.hasOwnProperty(e))))){const e="string"===d.fields?.find((e=>u(e.name,t)))?.type,i=y.map((r=>`${t} = ${e?`'${r.getAttribute(t)}'`:r.getAttribute(t)}`)).join(" OR ");yield*p.queryProvider.query(r,i,c)}else yield*y.map((t=>e(t,{source:r})))}else yield*t.empty()}()}async _count(e,t,r){const i=await l(e,t);return{source:e,count:i?i.length:0}}_supportsQuery(e){return!0}async _applyTolerance(e){return e}}async function l(e,t){const i=a(e.sublayer),s=i?e.layerExtension?.mapExtension:e.mapExtension,n=i?e.sublayer:e.layer,o=e._layerView.view;if("map"===s.viewMode||!o)return;const u=await o.hitTest(o.toScreen(r(t)?t:t.extent.center));let y=u?u.results.sort(p).map((e=>e.graphic)).filter((e=>(e.sourceLayer??e.layer)===n)):void 0;const l=i?e.sublayer.objectIdField:e.layer.objectIdField;if(y&&l){const e=new Set(y.map((e=>e.getAttribute(l))));y=[...e].map((e=>y.find((t=>t.getAttribute(l)===e))))}return y}function p(e,t){return e.distance<=t.distance?-1:1}
|
|
@@ -32,7 +32,7 @@ export declare abstract class IdentifyProviderBase implements IdentifyProvider {
|
|
|
32
32
|
* @param geometryType The geometry type before a tolerance buffer is
|
|
33
33
|
* applied.
|
|
34
34
|
*/
|
|
35
|
-
protected _identifyMany(sources: FeatureSource[], geometry: GeometryUnion, options
|
|
35
|
+
protected _identifyMany(sources: FeatureSource[], geometry: GeometryUnion, options?: IdentifyOptions, geometryType?: string): AsyncIterable<Feature>;
|
|
36
36
|
/**
|
|
37
37
|
* Adds a tolerance to input geometries if configured in the options.
|
|
38
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import i from"@arcgis/core/core/Collection";import{isLayerExtension as r,isMapExtension as t,isSublayerExtension as o}from"../../ItemType.js";import{MapExtension as s}from"../../mapping/MapExtension.js";import{InitializableBase as n}from"../../support/InitializableBase.js";import{serializable as d}from"../../support/Serializable.js";import{isCancellation as a}from"../../support/utilities.js";import{AsyncQueue as y,empty as f}from"../../utilities/asyncIterable.js";import{checkArg as p}from"../../utilities/checkArg.js";import{createCrossTypeUnion as l}from"../../utilities/geometry.js";import{isMap as u}from"../../utilities/mapping.js";import{parallelEach as c}from"../../utilities/promise.js";import{IdentifyError as v}from"./IdentifyError.js";import{IdentifyOptions as w}from"./IdentifyOptions.js";let m=class extends n{providers=new i;isSupported(e,i,r){return!!this.providers.find((t=>t.isSupported(e,i,r)))}identify(e,r,o){p("sources",e).isNotMissing(),p("geometry",r).isNotMissing();const n={...w.DEFAULTS,...o},{outSpatialReference:d,onSourceComplete:m}=n;if(void 0!==o?.maxResults&&o.maxResults<=0)return f();let h,S;Array.isArray(r)?(p("geometry",r).isNotEmpty(),h=r):h=[r];let I=[];i.isCollection(e)?I=e.toArray():t(e)?S=e:u(e)?S=new s({map:e}):I=[...e];let P=0;const g=new y,L=new Map,b=(e,i,r)=>{if(!i||0===e.length)return;P++;const t=new Map;for(const i of e)t.set(i,{source:i,count:0,time:-1});(async()=>{try{if(g.isDone)return;const o=Date.now();await c(e,(e=>e.initialize()));for await(const s of i.identify(e,r,n)){const e=t.get(s.source);if(e&&(e.count++,e.time<0&&(e.time=Date.now()-o)),g.isDone)return;d&&(s.schema.spatialReference=d),g.add(s)}for(const i of e){const e=t.get(i);e&&e.time<0&&(e.time=Date.now()-o)}}catch(i){for(const r of e){const e=t.get(r);e&&(e.failureReason=i)}if(a(i))return void g.reject(i);L.set(e,i)}finally{for(const i of e){const e=t.get(i);e&&m?.(e)}}0==--P&&(L.size?g.reject(new v(L)):g.done())})()};return(async()=>{await this.initialize();try{S&&(await S.initialize(),I=S.getAllFeatureSources(isIdentifiable))}catch(e){g.reject(new Error("Map failed to initialize.",{cause:e}))}if(g.isDone)return;const e=await l(h),i=new Map;for(const r of I)for(const t of e){const e=this.providers.find((e=>e.isSupported(r,t,n)));if(null!=e)if(i.has(e)){const o=i.get(e);o.has(t)?o.get(t).push(r):o.set(t,[r])}else i.set(e,new Map([[t,[r]]]))}for(const[e,r]of i)for(const[i,t]of r)b(t,e,i);0===P&&g.done()})(),g}count(e,r,o){p("sources",e).isNotMissing(),p("geometry",r).isNotMissing();const n={...o,returnGeometry:!1};let d,f=[];i.isCollection(e)?f=e.toArray():t(e)?d=e:u(e)?d=new s({map:e}):f=[...e];let l=0;const c=new y,w=new Map,m=e=>{const i=this.providers.find((i=>i.isSupported(e,r,o)));i&&(l++,(async()=>{if(!c.isDone){try{if(await e.initialize(),c.isDone)return;c.add(await i.count(e,r,n))}catch(i){if(a(i))return void c.reject(i);w.set(e,i)}0==--l&&(w.size?c.reject(new v(w)):c.done())}})())};return(async()=>{await this.initialize();try{d&&(await d.initialize(),f=d.getAllFeatureSources(isIdentifiable))}catch(e){c.reject(new Error("Map failed to initialize.",{cause:e}))}f.forEach(m),0===l&&c.done()})(),c}async _onInitialize(){await super._onInitialize();const{ArcGISSublayerQueryIdentifyProvider:e,ArcGISSublayerIdentifyProvider:i,BuildingComponentSublayerClientSideIdentifyProvider:r,BuildingComponentSublayerHitTestIdentifyProvider:t,CSVLayer3DHitTestIdentifyProvider:o,CSVLayerClientSideQueryIdentifyProvider:s,FeatureLayer3DHitTestIdentifyProvider:n,FeatureLayerClientSideIdentifyProvider:d,FeatureLayerQueryIdentifyProvider:a,GeoJSONLayer3DHitTestIdentifyProvider:y,GeoJSONLayerClientSideQueryIdentifyProvider:f,GeoRSSLayerIdentifyProvider:p,GraphicsLayerQueryIdentifyProvider:l,ImageryLayerIdentifyProvider:u,KMLLayerQueryIdentifyProvider:c,MapNotesSublayerQueryIdentifyProvider:v,PointCloudLayerHitTestIdentifyProvider:w,RouteLayerQueryIdentifyProvider:m,SceneLayerClientSideIdentifyProvider:h,SceneLayerHitTestIdentifyProvider:S,SceneLayerQueryIdentifyProvider:I,StreamLayerClientSideQueryIdentifyProvider:P,SubtypeSublayerClientSideIdentifyProvider:g,SubtypeSublayerQueryIdentifyProvider:L,WFSLayerClientSideIdentifyProvider:b,WFSLayerQueryIdentifyProvider:j,WMSSublayerIdentifyProvider:C,WMSLayerFeatureInfoIdentifyProvider:M}=await import("./defaultProviders.js");this.providers.add(new e),this.providers.add(new i),this.providers.add(new o),this.providers.add(new s),this.providers.add(new n),this.providers.add(new d),this.providers.add(new a),this.providers.add(new y),this.providers.add(new f),this.providers.add(new p),this.providers.add(new u),this.providers.add(new c),this.providers.add(new b),this.providers.add(new j),this.providers.add(new C),this.providers.add(new w),this.providers.add(new S),this.providers.add(new I),this.providers.add(new h),this.providers.add(new P),this.providers.add(new l),this.providers.add(new t),this.providers.add(new r),this.providers.add(new g),this.providers.add(new L),this.providers.add(new m),this.providers.add(new v),this.providers.add(new M)}};m=e([d],m);export{m as IdentifyService};export function isIdentifiable(e){return!!e.taskSettings.enableIdentify&&(r(e)?e.layer?.visible:!o(e)||e.sublayer?.visible)}
|
|
1
|
+
import{__decorate as e}from"tslib";import i from"@arcgis/core/core/Collection";import{isLayerExtension as r,isMapExtension as t,isSublayerExtension as o}from"../../ItemType.js";import{MapExtension as s}from"../../mapping/MapExtension.js";import{InitializableBase as n}from"../../support/InitializableBase.js";import{serializable as d}from"../../support/Serializable.js";import{isCancellation as a}from"../../support/utilities.js";import{AsyncQueue as y,empty as f}from"../../utilities/asyncIterable.js";import{checkArg as p}from"../../utilities/checkArg.js";import{createCrossTypeUnion as l}from"../../utilities/geometry.js";import{isMap as u}from"../../utilities/mapping.js";import{parallelEach as c}from"../../utilities/promise.js";import{IdentifyError as v}from"./IdentifyError.js";import{IdentifyOptions as w}from"./IdentifyOptions.js";let m=class extends n{providers=new i;isSupported(e,i,r){return!!this.providers.find((t=>t.isSupported(e,i,r)))}identify(e,r,o){p("sources",e).isNotMissing(),p("geometry",r).isNotMissing();const n={...w.DEFAULTS,...o},{outSpatialReference:d,onSourceComplete:m}=n;if(void 0!==o?.maxResults&&o.maxResults<=0)return f();let h,S;Array.isArray(r)?(p("geometry",r).isNotEmpty(),h=r):h=[r];let I=[];i.isCollection(e)?I=e.toArray():t(e)?S=e:u(e)?S=new s({map:e}):I=[...e];let P=0;const g=new y,L=new Map,b=(e,i,r)=>{if(!i||0===e.length)return;P++;const t=new Map;for(const i of e)t.set(i,{source:i,count:0,time:-1});(async()=>{try{if(g.isDone)return;const o=Date.now();await c(e,(e=>e.initialize()));for await(const s of i.identify(e,r,n)){const e=t.get(s.source);if(e&&(e.count++,e.time<0&&(e.time=Date.now()-o)),g.isDone)return;d&&(s.schema.spatialReference=d),g.add(s)}for(const i of e){const e=t.get(i);e&&e.time<0&&(e.time=Date.now()-o)}}catch(i){for(const r of e){const e=t.get(r);e&&(e.failureReason=i)}if(a(i))return void g.reject(i);L.set(e,i)}finally{for(const i of e){const e=t.get(i);e&&m?.(e)}}0==--P&&(L.size?g.reject(new v(L)):g.done())})()};return(async()=>{await this.initialize();try{S&&(await S.initialize(),I=S.getAllFeatureSources(isIdentifiable))}catch(e){g.reject(new Error("Map failed to initialize.",{cause:e}))}if(g.isDone)return;const e=await l(h),i=new Map;for(const r of I)for(const t of e){const e=this.providers.find((e=>e.isSupported(r,t,n)));if(null!=e)if(i.has(e)){const o=i.get(e);o.has(t)?o.get(t).push(r):o.set(t,[r])}else i.set(e,new Map([[t,[r]]]))}for(const[e,r]of i)for(const[i,t]of r)b(t,e,i);0===P&&g.done()})(),g}count(e,r,o){p("sources",e).isNotMissing(),p("geometry",r).isNotMissing();const n={...o,returnGeometry:!1};let d,f=[];i.isCollection(e)?f=e.toArray():t(e)?d=e:u(e)?d=new s({map:e}):f=[...e];let l=0;const c=new y,w=new Map,m=e=>{const i=this.providers.find((i=>i.isSupported(e,r,o)));i&&(l++,(async()=>{if(!c.isDone){try{if(await e.initialize(),c.isDone)return;c.add(await i.count(e,r,n))}catch(i){if(a(i))return void c.reject(i);w.set(e,i)}0==--l&&(w.size?c.reject(new v(w)):c.done())}})())};return(async()=>{await this.initialize();try{d&&(await d.initialize(),f=d.getAllFeatureSources(isIdentifiable))}catch(e){c.reject(new Error("Map failed to initialize.",{cause:e}))}f.forEach(m),0===l&&c.done()})(),c}async _onInitialize(){await super._onInitialize();const{ArcGISSublayerQueryIdentifyProvider:e,ArcGISSublayerIdentifyProvider:i,BuildingComponentSublayerClientSideIdentifyProvider:r,BuildingComponentSublayerHitTestIdentifyProvider:t,CSVLayer3DHitTestIdentifyProvider:o,CSVLayerClientSideQueryIdentifyProvider:s,FeatureLayer3DHitTestIdentifyProvider:n,FeatureLayerClientSideIdentifyProvider:d,FeatureLayerQueryIdentifyProvider:a,GeoJSONLayer3DHitTestIdentifyProvider:y,GeoJSONLayerClientSideQueryIdentifyProvider:f,GeoRSSLayerIdentifyProvider:p,GraphicsLayerQueryIdentifyProvider:l,ImageryLayerIdentifyProvider:u,KMLLayerQueryIdentifyProvider:c,MapNotesSublayerQueryIdentifyProvider:v,PointCloudLayerHitTestIdentifyProvider:w,RouteLayerQueryIdentifyProvider:m,SceneLayerClientSideIdentifyProvider:h,SceneLayerHitTestIdentifyProvider:S,SceneLayerQueryIdentifyProvider:I,StreamLayerClientSideQueryIdentifyProvider:P,SubtypeSublayerClientSideIdentifyProvider:g,SubtypeSublayerQueryIdentifyProvider:L,WFSLayerClientSideIdentifyProvider:b,WFSLayerQueryIdentifyProvider:j,WMSSublayerIdentifyProvider:C,WMSLayerFeatureInfoIdentifyProvider:M}=await import("./defaultProviders.js");this.providers.add(new e),this.providers.add(new i),this.providers.add(new o),this.providers.add(new s),this.providers.add(new n),this.providers.add(new d),this.providers.add(new a),this.providers.add(new y),this.providers.add(new f),this.providers.add(new p),this.providers.add(new u),this.providers.add(new c),this.providers.add(new b),this.providers.add(new j),this.providers.add(new C),this.providers.add(new w),this.providers.add(new S),this.providers.add(new I),this.providers.add(new h),this.providers.add(new P),this.providers.add(new l),this.providers.add(new t),this.providers.add(new r),this.providers.add(new g),this.providers.add(new L),this.providers.add(new m),this.providers.add(new v),this.providers.add(new M)}};m=e([d],m);export{m as IdentifyService};export function isIdentifiable(e){return!!e.taskSettings.enableIdentify&&(r(e)?e.layer?.visible:!o(e)||(e.sublayer?.visible??!1))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@arcgis/core/geometry/Point";import t from"@arcgis/core/geometry/Polygon";import{identify as r}from"@arcgis/core/rest/imageService";import a from"@arcgis/core/rest/support/ImageIdentifyParameters";import i from"@arcgis/core/rest/support/ProjectParameters";import{Feature as s,toFeature as o}from"../../data/Feature.js";import{cancelifyWithAbortSignal as n}from"../../support/Cancellable.js";import{constrainQueryTimeExtentToView as c}from"../../support/_query.js";import{toArray as l}from"../../utilities/asyncIterable.js";import{isPoint as u,isPolygon as m,isPolyline as f}from"../../utilities/esri.js";import{isImageryLayerExtension as p}from"../../utilities/extensions.js";import{getLogger as y}from"../../utilities/log.js";import{isNumeric as g}from"../../utilities/number.js";import{IdentifyProviderBase as d}from"./IdentifyProviderBase.js";const I=y("ImageryLayerIdentifyProvider"),h="Raster.";export class ImageryLayerIdentifyProvider extends d{isSupported(e,t,r){return p(e)}async*_identify(r,a,i){const s=r;let o=a;if(a&&!u(a)&&!m(a))if(f(a)){I.debug("An identify on an Imagery Layer (ArcGISImageServiceLayer) was performed using polyline geometry, which is not supported. The center vertex of in the input geometry was used instead.");const t=a.paths[0][Math.floor(a.paths[0].length/2)];o=new e({spatialReference:a.spatialReference,x:t[0],y:t[1]})}else o=t.fromExtent(a.extent);const n=await this._executeIdentifyTask(s,o,i);yield*this._getResultFeatures(n,s,i)}async _count(e,t,r){const a=e;r.returnGeometry=!1;const i=await this._executeIdentifyTask(a,t,r);return{source:e,count:(await l(this._getResultFeatures(i,a,r))).length}}async _executeIdentifyTask(e,t,i){const{layer:s}=e,o=new a({geometry:t,mosaicRule:s.mosaicRule,rasterFunction:s.rasterFunction,returnCatalogItems:e.includeCatalogItems,returnGeometry:e.includeCatalogItems&&i.returnGeometry});c(o,e);return n((async e=>r(s.url,o,{signal:e})),i.cancelToken)}_getPixelData(e,t,r,a){const{layer:i}=a;let s=r.properties?.Values[e]??r.value,o=r.value;g(s)&&(s=parseFloat(s)),g(o)&&(o=parseFloat(o)),t.attributes.set(`${h}ServicePixelValue`,o),t.attributes.set(`${h}ServicePixelValue.Raw`,o),t.attributes.set(`${h}ItemPixelValue`,s);const n=i.serviceRasterInfo?.attributeTable??i.rasterInfo?.attributeTable;if(n){const{features:e,fields:r}=n,a=e.find((e=>e.getAttribute("Value")===s));r.forEach((e=>{"Value"!==e.name&&"oid"!==e.type&&t.attributes.set(`${h}${e.name}`,a?.getAttribute(e.name))}))}}async*_getResultFeatures(e,t,r){if("NoData"===e.value)return;const a=r.outSpatialReference&&r.outSpatialReference.wkid!==t.layer.spatialReference.wkid;if(t.includeCatalogItems&&e.catalogItems){let i=Promise.resolve([]);a&&r.returnGeometry&&(i=this._projectGeometries(t.layer.url,e.catalogItems.features.map((e=>e.geometry)),r.outSpatialReference,r.cancelToken));const s=[],n=r.outFields||t.featureSettings.outFields;e.catalogItems.features.forEach(((r,a)=>{const i=o(r,{source:t});if(n&&!n.includes("*"))for(const e of i.attributes.keys())n.includes(e)||i.attributes.delete(e);i.attributes.set("visible",1===e.catalogItemVisibilities[a]),this._getPixelData(a,i,e,t),s.push(i)}));const c=await i;c.length>0&&c.forEach(((e,t)=>s[t].geometry=e)),yield*s}if(!t.includeCatalogItems||!e.catalogItems){const i=new s({source:t});i.geometry=a?(await this._projectGeometries(t.layer.url,[e.location],r.outSpatialReference,r.cancelToken))[0]:e.location,this._getPixelData(0,i,e,t),yield i}}async _projectGeometries(e,t,r,a){const s=new i({geometries:t,outSpatialReference:r}),{project:o}=await import("@arcgis/core/rest/geometryService");return n((async t=>o(e,s,{signal:t})),a)}}
|
|
1
|
+
import e from"@arcgis/core/geometry/Point";import t from"@arcgis/core/geometry/Polygon";import{identify as r}from"@arcgis/core/rest/imageService";import a from"@arcgis/core/rest/support/ImageIdentifyParameters";import i from"@arcgis/core/rest/support/ProjectParameters";import{Feature as s,toFeature as o}from"../../data/Feature.js";import{cancelifyWithAbortSignal as n}from"../../support/Cancellable.js";import{constrainQueryTimeExtentToView as c}from"../../support/_query.js";import{toArray as l}from"../../utilities/asyncIterable.js";import{isPoint as u,isPolygon as m,isPolyline as f}from"../../utilities/esri.js";import{isImageryLayerExtension as p}from"../../utilities/extensions.js";import{getLogger as y}from"../../utilities/log.js";import{isNumeric as g}from"../../utilities/number.js";import{IdentifyProviderBase as d}from"./IdentifyProviderBase.js";const I=y("ImageryLayerIdentifyProvider"),h="Raster.";export class ImageryLayerIdentifyProvider extends d{isSupported(e,t,r){return p(e)}async*_identify(r,a,i){const s=r;let o=a;if(a&&!u(a)&&!m(a))if(f(a)){I.debug("An identify on an Imagery Layer (ArcGISImageServiceLayer) was performed using polyline geometry, which is not supported. The center vertex of in the input geometry was used instead.");const t=a.paths[0][Math.floor(a.paths[0].length/2)];o=new e({spatialReference:a.spatialReference,x:t[0],y:t[1]})}else o=t.fromExtent(a.extent);const n=await this._executeIdentifyTask(s,o,i);yield*this._getResultFeatures(n,s,i)}async _count(e,t,r){const a=e;r.returnGeometry=!1;const i=await this._executeIdentifyTask(a,t,r);return{source:e,count:(await l(this._getResultFeatures(i,a,r))).length}}async _executeIdentifyTask(e,t,i){const{layer:s}=e,o=new a({geometry:t,mosaicRule:s.mosaicRule,rasterFunction:s.rasterFunction,returnCatalogItems:e.includeCatalogItems,returnGeometry:e.includeCatalogItems&&i.returnGeometry});c(o,e);return n((async e=>r(s.url,o,{signal:e})),i.cancelToken)}_getPixelData(e,t,r,a){const{layer:i}=a;let s=r.properties?.Values?.[e]??r.value,o=r.value;g(s)&&(s=parseFloat(s)),g(o)&&(o=parseFloat(o)),t.attributes.set(`${h}ServicePixelValue`,o),t.attributes.set(`${h}ServicePixelValue.Raw`,o),t.attributes.set(`${h}ItemPixelValue`,s);const n=i.serviceRasterInfo?.attributeTable??i.rasterInfo?.attributeTable;if(n){const{features:e,fields:r}=n,a=e.find((e=>e.getAttribute("Value")===s));r.forEach((e=>{"Value"!==e.name&&"oid"!==e.type&&t.attributes.set(`${h}${e.name}`,a?.getAttribute(e.name))}))}}async*_getResultFeatures(e,t,r){if("NoData"===e.value)return;const a=r.outSpatialReference&&r.outSpatialReference.wkid!==t.layer.spatialReference.wkid;if(t.includeCatalogItems&&e.catalogItems){let i=Promise.resolve([]);a&&r.returnGeometry&&(i=this._projectGeometries(t.layer.url,e.catalogItems.features.map((e=>e.geometry)),r.outSpatialReference,r.cancelToken));const s=[],n=r.outFields||t.featureSettings.outFields;e.catalogItems.features.forEach(((r,a)=>{const i=o(r,{source:t});if(n&&!n.includes("*"))for(const e of i.attributes.keys())n.includes(e)||i.attributes.delete(e);i.attributes.set("visible",1===e.catalogItemVisibilities?.[a]),this._getPixelData(a,i,e,t),s.push(i)}));const c=await i;c.length>0&&c.forEach(((e,t)=>s[t].geometry=e)),yield*s}if(!t.includeCatalogItems||!e.catalogItems){const i=new s({source:t});i.geometry=a?(await this._projectGeometries(t.layer.url,[e.location],r.outSpatialReference,r.cancelToken))[0]:e.location,this._getPixelData(0,i,e,t),yield i}}async _projectGeometries(e,t,r,a){const s=new i({geometries:t,outSpatialReference:r}),{project:o}=await import("@arcgis/core/rest/geometryService");return n((async t=>o(e,s,{signal:t})),a)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as t,constrainQueryTimeExtentToView as r}from"../../support/_query.js";import{AsyncQueue as s}from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as i}from"../../utilities/extensions.js";import{removeZValues as o}from"../../utilities/geometry.js";import{isSubtypeSublayer as u}from"../../utilities/layers.js";import{caseInsensitiveEquals as n}from"../../utilities/string.js";import{IdentifyOptions as
|
|
1
|
+
import{executeQuery as e,executeCount as t,constrainQueryTimeExtentToView as r}from"../../support/_query.js";import{AsyncQueue as s}from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as i}from"../../utilities/extensions.js";import{removeZValues as o}from"../../utilities/geometry.js";import{isSubtypeSublayer as u}from"../../utilities/layers.js";import{caseInsensitiveEquals as n}from"../../utilities/string.js";import{IdentifyOptions as a}from"./IdentifyOptions.js";import{IdentifyProviderBase as l}from"./IdentifyProviderBase.js";export class SubtypeSublayerQueryIdentifyProvider extends l{isSupported(e,t,r){return i(e)&&u(e.sublayer)&&!!e.sublayer.layer}_identify(t,r,s){const i=t,{layer:o}=i.sublayer,u=this._createIdentifyQuery(o,r,s,s.outFields??t.featureSettings.outFields);return u.where=`${o.subtypeField}=${i.sublayer.subtypeCode}`,u.returnZ=o.hasZ,e(u,i,o,s.cancelToken)}_identifyMany(t,i,o){if(1===t.length){const e={...a.DEFAULTS,...a.fromFeatureSource(t[0]),...o};return this._identify(t[0],i,e)}const u=new s,l=t.length;let y=0;const f=t.reduce(((e,t)=>{const r=t,s={...a.DEFAULTS,...a.fromFeatureSource(r),...o},i=s.outFields??r.featureSettings.outFields;if(e.has(r.sublayer.layer)){const t=e.get(r.sublayer.layer);let o=!1;for(const{sources:e,identifyOptions:a,outFields:y}of t)if(l=s,(u=a).returnGeometry===l.returnGeometry&&(u.outSpatialReference===l.outSpatialReference||u.outSpatialReference?.equals(l.outSpatialReference))&&u.maxAllowableOffset===l.maxAllowableOffset&&u.maxResults===l.maxResults&&i.length===y.length&&i.every((e=>y.some((t=>n(e,t)))))){e.push(r),o=!0;break}o||t.push({sources:[r],identifyOptions:s,outFields:i})}else e.set(r.sublayer.layer,[{sources:[r],identifyOptions:s,outFields:i}]);var u,l;return e}),new Map);for(const[t,s]of f)for(const{sources:o,identifyOptions:a,outFields:f}of s)(async()=>{if(u.isDone)return;const s=new Map,c=[];for(const e of o)s.set(e.sublayer.subtypeCode,e),c.push(e.sublayer.subtypeCode);const d=this._createIdentifyQuery(t,i,a,f);let p=!1;d.outFields.some((e=>"*"===e||n(e,t.subtypeField)))||(p=!0,d.outFields=[...d.outFields,t.subtypeField]),d.where=`${t.subtypeField} IN (${c.join(",")})`,r(d,o[0]);try{for await(const r of e(d,(e=>{const r=e.attributes;let i=r[t.subtypeField];if(void 0===i){i=r[Object.keys(r).find((e=>n(e,t.subtypeField)))]}return s.get(i)}),t,a.cancelToken)){if(u.isDone)return;p&&r.attributes.delete(t.subtypeField),u.add(r)}}catch(e){u.reject(e)}finally{y+=o.length,y===l&&u.done()}})();return u}_count(e,r,s){const i=e,{layer:o}=i.sublayer,u=this._createBasicQuery(o,r,s,s.outFields??e.featureSettings.outFields);return u.num=s.maxResults,u.where=`${o.subtypeField}=${i.sublayer.subtypeCode}`,t(u,i,o,s.cancelToken)}_createIdentifyQuery(e,t,r,s){const i=this._createBasicQuery(e,t,r,s);return i.outSpatialReference=r.outSpatialReference,i.maxAllowableOffset=r.maxAllowableOffset,e.capabilities.query.supportsPagination&&(i.num=r.maxResults),i}_createBasicQuery(e,t,r,s){const i=e.createQuery();return i.geometry=t,(e.hasZ||e.capabilities?.data?.supportsZ)&&(i.geometry&&(i.geometry=o(t.clone())),i.returnZ=!0),i.outFields=s,i.returnGeometry=r.returnGeometry??i.returnGeometry,i}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isWFSLayerExtension as r}from"../../utilities/extensions.js";import{IdentifyProviderBase as o}from"./IdentifyProviderBase.js";export class WFSLayerQueryIdentifyProvider extends o{isSupported(e,t,o){return r(e)}_identify(t,r,o){const
|
|
1
|
+
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isWFSLayerExtension as r}from"../../utilities/extensions.js";import{IdentifyProviderBase as o}from"./IdentifyProviderBase.js";export class WFSLayerQueryIdentifyProvider extends o{isSupported(e,t,o){return r(e)}_identify(t,r,o){const u=t,s=u.layer.createQuery(),n=r;return s.geometry=n,s.outFields=o.outFields??t.featureSettings.outFields,s.returnGeometry=o.returnGeometry??s.returnGeometry,s.outSpatialReference=o.outSpatialReference,s.maxAllowableOffset=o.maxAllowableOffset,u.layer.capabilities.query.supportsPagination&&(s.num=o.maxResults),e(s,u,u.layer,o.cancelToken)}_count(e,r,o){const u=e,s=u.layer.createQuery();return s.geometry=r,s.num=o.maxResults,s.returnGeometry=o.returnGeometry??s.returnGeometry,s.outFields=o.outFields??e.featureSettings.outFields,t(s,u,u.layer,o.cancelToken)}}
|
|
@@ -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)))&&!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
|
|
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)))??!1)&&!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)}null!=s&&(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||(a.fieldInfos=[]),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 +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 s}from"../../utilities/RequestHelper.js";import{OgcNamespace as i,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 s;isSupported(e,t,r){return o(e)&&void 0!==e.layerExtension?.wfsUrl}_identify(e,t,s){const i=(async()=>{if(await e.initialize(),await e.initializeWfs(),!e.wfsLayerInfo)return;const r=await this._createGetFeatureSpatialQuery(e,t,s),i={method:"post",body:(new XMLSerializer).serializeToString(r),headers:{"Content-Type":"text/xml; charset=utf-8"}};return this.requestHelper.request(e.layerExtension.wfsUrl,i)})();return async function*(){const t=await i;if(t){const s=await t.text(),i=(new DOMParser).parseFromString(s,"text/xml");if(!t||!i||i.childNodes.length<1)throw new Error("Response to WFS GetFeature request was invalid.");yield*await r(i.childNodes[0],e)}}()}async _count(e,t,s={}){const i=(async()=>{if(await e.initialize(),await e.initializeWfs(),!e.wfsLayerInfo)return;const r=await this._createGetFeatureSpatialQuery(e,t,s),i={method:"post",body:(new XMLSerializer).serializeToString(r),headers:{"Content-Type":"text/xml; charset=utf-8"}};return this.requestHelper.request(e.layerExtension.wfsUrl,i)})();let a;const n=await i;if(n){const t=await n.text(),s=(new DOMParser).parseFromString(t,"text/xml");if(!n||!s||s.childNodes.length<1)throw new Error("Response to WFS GetFeature request was invalid.");a=await r(s.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 s=e.wfsLayerInfo,i=s.wfsCapabilities.featureTypes.find((e=>e.namespaceUri===s.namespaceUri&&e.name===s.name)),a=this._createGetFeatureElement(r),o=await this._createQueryElement(i,t);a.appendChild(o);let l=s.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",i.XS),t.setAttribute("xmlns:ogc",i.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",i.FES_2_0),t}async _createQueryElement(e,t){const r=this._createElement("wfs","Query"),s=await this._getCompatibleSR(e,t),i=this._getSrsName(s);return r.setAttribute("typeNames",e.name),r.setAttribute("srsName",i),r}_createGeometryFieldElement(e){const{geometryField:r}=e.wfsLayerInfo;if(!r)throw new t("The WFS feature type does not have a geometry field");const s=this._createElement("fes","ValueReference");return s.textContent=r,s}async _createGeometryElement(e,t){n("geometry",t).isNotMissing(),n("geometry.spatialReference",t.spatialReference).isNotMissing();const r={gmlVersion:a(p)},s=await this._getCompatibleSR(e.wfsFeatureType,t);if(r.srsName=this._getSrsName(s),s.equals(t.spatialReference))return l(t,r);{const s=await this.projectGeometry(t,e.wfsFeatureType.defaultSpatialReference);return l(s,r)}}async projectGeometry(t,r){const s=await c([t],new e({wkid:r}));if(s&&s.length>0)return s[0];throw new Error("Unable to create a geometry element.")}_createElement(e,t){n("name",t).isNotMissing();const r=document.implementation.createDocument(null,"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 i.WFS;default:return i.WFS_2_0}}_getGmlNameSpace(e){switch(e){case"1.0.0":case"1.1.0":return i.GML;default:return i.GML_3_2}}async _getCompatibleSR(t,r){n("wfsFeatureType",t).isNotMissing(),n("geometry",r).isNotMissing();const s=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(s)))??new e({wkid:t.defaultSpatialReference})}_getSrsName(e){return`EPSG:${e.wkid}`}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import i from"@arcgis/core/rest/support/RelationshipQuery";import{
|
|
1
|
+
import{__decorate as e}from"tslib";import i from"@arcgis/core/rest/support/RelationshipQuery";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{isSublayerExtension as r}from"../../ItemType.js";import{RelationshipBase as a}from"../../data/RelationshipBase.js";import{cancelifyWithAbortSignal as s}from"../../support/Cancellable.js";import{serializable as o}from"../../support/Serializable.js";import{isFeatureLayer as l,isMapImageSublayer as n,isSubtypeGroupLayer as u}from"../../utilities/_layers.js";import{checkArg as p}from"../../utilities/checkArg.js";import{isArcGISServiceTableExtension as y,isFeatureLayerExtension as d,isSubtypeGroupLayerExtension as c,isSubtypeSublayerExtension as m}from"../../utilities/extensions.js";import{QueryService as h}from"./QueryService.js";const f="Cannot get related features without feature source.",g=new WeakMap;let F=class extends a{relatedSource;cardinality;keyField;relationshipType="ArcGISRelationship";queryService;relatedKeyField;relationshipTableId;originForeignKey;destinationForeignKey;constructor(e){super(e),p("properties",e).isNotMissing(),p("properties.relatedSource",e.relatedSource).isNotMissing(),p("properties.keyField",e.keyField).isNotMissing().isNotEmpty(),this.relatedSource=e.relatedSource,this.keyField=e.keyField,this.relatedKeyField=e.relatedKeyField,this.cardinality=e.cardinality||"many-to-many",this.relationshipTableId=e.relationshipTableId,this.queryService=e.queryService||new h,this.originForeignKey=e.originForeignKey,this.destinationForeignKey=e.destinationForeignKey}get isAttributed(){return"number"==typeof this.relationshipTableId}_getSerializableProperties(){return{...super._getSerializableProperties(),keyField:"initial",relatedKeyField:"initial",$relationshipType:{serializeModes:["initial"],serialize:()=>"ArcGISRelationship"},cardinality:"initial",relatedSource:"initial",queryService:{serialize:!1},destinationForeignKey:"initial",originForeignKey:"initial",relationshipTableId:"initial"}}async _getRelatedFeatures(e,i){if(!this.source)throw new t(f);return s((async i=>(await w([e],S(this.source),this.relatedSource,{relationshipId:+this.id,signal:i})).get(e)),i?.cancelToken)}async _getAllRelatedFeatures(e){if(!this.source)throw new t(f);return w(e,S(this.source),this.relatedSource,{relationshipId:+this.id})}};F=e([o],F);export{F as ArcGISRelationship};function S(e){let i;if(y(e))i=e.table;else if(d(e))i=e.layer;else if(r(e)&&n(e.sublayer))i=e.sublayer;else if(m(e)&&e.sublayer?.layer)i=e.sublayer.layer;else{if(!c(e))throw new Error(`Cannot query for related records. Unsupported FeatureSource: ${e.title} (${e.itemType}/${e.id})`);i=e.layer}return i}const b={returnGeometry:!0};async function w(e,t,r,a){const s=e.map((e=>null==e.primaryKey?NaN:+e.primaryKey)),{signal:o,...n}=a,p=new i({...b,objectIds:s.filter((e=>!isNaN(e)&&"number"==typeof e)),outFields:r?.featureSettings.outFields??["*"],...n});let y;if(l(t)||u(t))y=t;else{const e=t;if(!g.has(e)){const i=await e.createFeatureLayer();i&&g.set(e,i)}y=g.get(e)}const d=await y.queryRelatedFeatures(p,{signal:o}),c=new Map,[m,h]=await Promise.all([(await import("../../data/FeatureSet.js")).FeatureSet,(await import("../../data/Feature.js")).toFeature]);return s.forEach(((i,t)=>{c.set(e[t],new m({source:r,features:d[i]?.features.map((e=>h(e,{source:r})))??[]}))})),c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCountByQuery as r}from"../../support/_query.js";import{isMapImageSublayerExtension as t}from"../../utilities/extensions.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class ArcGISSublayerQueryProvider extends s{isSupported(e){return t(e)&&e.capabilities.supportsQuery}_query(r,t,s){const{sublayer:a}=r,
|
|
1
|
+
import{executeQuery as e,executeCountByQuery as r}from"../../support/_query.js";import{isMapImageSublayerExtension as t}from"../../utilities/extensions.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class ArcGISSublayerQueryProvider extends s{isSupported(e){return t(e)&&e.capabilities.supportsQuery}_query(r,t,s){const{sublayer:a}=r,o=a.createQuery();return o.where=t,o.outFields=s.outFields,o.returnGeometry=s.returnGeometry??o.returnGeometry,o.outSpatialReference=s.outSpatialReference,o.maxAllowableOffset=s.maxAllowableOffset,o.returnZ=a.layer?.sourceJSON?.hasZ,s.spatialFilter&&(o.spatialRelationship="intersects",o.geometry=s.spatialFilter),r.supportsPagination&&(o.num=s.maxResults),e(o,r,a,s.cancelToken)}_count(e,t,s){const{sublayer:a}=e,o=a.createQuery();return o.where=t,o.returnGeometry=s.returnGeometry??o.returnGeometry,o.outFields=s.outFields,s.spatialFilter&&(o.spatialRelationship="intersects",o.geometry=s.spatialFilter),o.num=s.maxResults,r(o,e,a,s.cancelToken)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isCSVLayer as r}from"../../utilities/_layers.js";import{removeZValues as s}from"../../utilities/geometry.js";import{QueryProviderBase as i}from"./QueryProviderBase.js";export class CSVLayerClientSideQueryProvider extends i{isSupported(e){const{layer:t}=e;return r(t)}_query(t,r,i){const{layer:
|
|
1
|
+
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isCSVLayer as r}from"../../utilities/_layers.js";import{removeZValues as s}from"../../utilities/geometry.js";import{QueryProviderBase as i}from"./QueryProviderBase.js";export class CSVLayerClientSideQueryProvider extends i{isSupported(e){const{layer:t}=e;return r(t)}_query(t,r,i){const{layer:o}=t,a=o.createQuery();a.where=r,a.outFields=i.outFields,a.returnGeometry=i.returnGeometry??a.returnGeometry,a.outSpatialReference=i.outSpatialReference,a.maxAllowableOffset=i.maxAllowableOffset,a.returnZ="scene"===t.mapExtension?.viewMode;let l=i.spatialFilter;return l&&(a.spatialRelationship="intersects",o.capabilities?.data?.supportsZ||(l=s(l.clone())),a.geometry=l),o.capabilities.query.supportsPagination&&(a.num=i.maxResults),e(a,t,o,i.cancelToken)}async _count(e,r,i){const{layer:o}=e,a=o.createQuery();a.where=r,a.outFields=i.outFields,a.returnGeometry=i.returnGeometry??a.returnGeometry;let l=i.spatialFilter;return l&&(a.spatialRelationship="intersects",l&&!o.capabilities?.data?.supportsZ&&(l=s(l.clone())),a.geometry=l),a.num=i.maxResults,t(a,e,o,i.cancelToken)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toFeature as e}from"../../data/Feature.js";import{cancelify as t,cancelifyWithAbortSignal as r}from"../../support/Cancellable.js";import{watch as i}from"../../support/observableUtils.js";import*as a from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as s}from"../../utilities/extensions.js";import{isBuildingComponentSublayer as n}from"../../utilities/layers.js";import{QueryProviderBase as o}from"./QueryProviderBase.js";export class ClientSideQueryProvider extends o{get _waitForUpdatingFinished(){return!0}_query(t,r,i){const s=this;return async function*(){const n=await s._getClientSideLayerGraphics(t,r,i);n?.length?yield*n.map((r=>e(r,{source:t}))):yield*a.empty()}()}async _count(e,t,r){const i=await this._getClientSideLayerGraphics(e,t,r);return{source:e,count:i?i.length:0}}_createQuery(e,t,r){const i=s(e)?e.layerExtension:e,{_layerView:a,featureSettings:o}=i,l=n(i.sublayer)?e.layerExtension?.mapExtension:e.mapExtension,u=a.createQuery();return u.where=t,u.geometry=r.spatialFilter,u.outFields=o.outFields,u.returnGeometry=r.returnGeometry,u.outSpatialReference=r.outSpatialReference,u.maxAllowableOffset=r.maxAllowableOffset,u.num=r.maxResults,u.returnZ="scene"===l?.viewMode,u}async _getClientSideLayerGraphics(e,a,n){const o=s(e)?e.layerExtension:e,{_layerView:l}=o;if(!l)return;this._waitForUpdatingFinished&&await t(new Promise(((e,t)=>{l.updating||e();const r=i(l,"updating",(t=>{t||(r.remove(),e())}))})),n.cancelToken);const u=await r((async t=>l.queryFeatures(this._createQuery(e,a,n),{signal:t})),n.cancelToken);return u?.features}}
|
|
1
|
+
import{toFeature as e}from"../../data/Feature.js";import{cancelify as t,cancelifyWithAbortSignal as r}from"../../support/Cancellable.js";import{watch as i}from"../../support/observableUtils.js";import*as a from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as s}from"../../utilities/extensions.js";import{isBuildingComponentSublayer as n}from"../../utilities/layers.js";import{QueryProviderBase as o}from"./QueryProviderBase.js";export class ClientSideQueryProvider extends o{get _waitForUpdatingFinished(){return!0}_query(t,r,i){const s=this;return async function*(){const n=await s._getClientSideLayerGraphics(t,r,i);n?.length?yield*n.map((r=>e(r,{source:t}))):yield*a.empty()}()}async _count(e,t,r){const i=await this._getClientSideLayerGraphics(e,t,r);return{source:e,count:i?i.length:0}}_createQuery(e,t,r){const i=s(e)?e.layerExtension:e,{_layerView:a,featureSettings:o}=i,l=n(i.sublayer)?e.layerExtension?.mapExtension:e.mapExtension,u=a.createQuery();return u.where=t,u.geometry=r.spatialFilter,u.outFields=o.outFields,u.returnGeometry=r.returnGeometry??u.returnGeometry,u.outSpatialReference=r.outSpatialReference,u.maxAllowableOffset=r.maxAllowableOffset,u.num=r.maxResults,u.returnZ="scene"===l?.viewMode,u}async _getClientSideLayerGraphics(e,a,n){const o=s(e)?e.layerExtension:e,{_layerView:l}=o;if(!l)return;this._waitForUpdatingFinished&&await t(new Promise(((e,t)=>{l.updating||e();const r=i(l,"updating",(t=>{t||(r.remove(),e())}))})),n.cancelToken);const u=await r((async t=>l.queryFeatures(this._createQuery(e,a,n),{signal:t})),n.cancelToken);return u?.features}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isFeatureLayer as r}from"../../utilities/_layers.js";import{removeZValues as s}from"../../utilities/geometry.js";import{QueryProviderBase as a}from"./QueryProviderBase.js";export class FeatureLayerQueryProvider extends a{isSupported(e){const{layer:t}=e;return r(t)&&e.capabilities.supportsQuery}_query(t,r,a){const{layer:i}=t,o=i.createQuery();o.where=r,o.outFields=a.outFields,o.returnGeometry=a.returnGeometry,o.outSpatialReference=a.outSpatialReference,o.maxAllowableOffset=a.maxAllowableOffset,o.returnZ=i.hasZ;let l=a.spatialFilter;return l&&(o.spatialRelationship="intersects",!l||i.hasZ&&i.capabilities?.data?.supportsZ||(l=s(l.clone())),o.geometry=l),i.capabilities.query.supportsPagination&&(o.num=a.maxResults),e(o,t,i,a.cancelToken)}_count(e,r,a){const{layer:i}=e,o=i.createQuery();o.where=r,o.outFields=a.outFields,o.returnGeometry=a.returnGeometry;let l=a.spatialFilter;return l&&(o.spatialRelationship="intersects",!l||i.hasZ&&i.capabilities?.data?.supportsZ||(l=s(l.clone())),o.geometry=l),o.num=a.maxResults,t(o,e,i,a.cancelToken)}}
|
|
1
|
+
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isFeatureLayer as r}from"../../utilities/_layers.js";import{removeZValues as s}from"../../utilities/geometry.js";import{QueryProviderBase as a}from"./QueryProviderBase.js";export class FeatureLayerQueryProvider extends a{isSupported(e){const{layer:t}=e;return r(t)&&e.capabilities.supportsQuery}_query(t,r,a){const{layer:i}=t,o=i.createQuery();o.where=r,o.outFields=a.outFields,o.returnGeometry=a.returnGeometry??o.returnGeometry,o.outSpatialReference=a.outSpatialReference,o.maxAllowableOffset=a.maxAllowableOffset,o.returnZ=i.hasZ;let l=a.spatialFilter;return l&&(o.spatialRelationship="intersects",!l||i.hasZ&&i.capabilities?.data?.supportsZ||(l=s(l.clone())),o.geometry=l),i.capabilities.query.supportsPagination&&(o.num=a.maxResults),e(o,t,i,a.cancelToken)}_count(e,r,a){const{layer:i}=e,o=i.createQuery();o.where=r,o.outFields=a.outFields,o.returnGeometry=a.returnGeometry??o.returnGeometry;let l=a.spatialFilter;return l&&(o.spatialRelationship="intersects",!l||i.hasZ&&i.capabilities?.data?.supportsZ||(l=s(l.clone())),o.geometry=l),o.num=a.maxResults,t(o,e,i,a.cancelToken)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isGeoJSONLayer as r}from"../../utilities/_layers.js";import{removeZValues as s}from"../../utilities/geometry.js";import{QueryProviderBase as a}from"./QueryProviderBase.js";export class GeoJSONLayerClientSideQueryProvider extends a{isSupported(e){const{layer:t}=e;return r(t)}_query(t,r,a){const{layer:
|
|
1
|
+
import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isGeoJSONLayer as r}from"../../utilities/_layers.js";import{removeZValues as s}from"../../utilities/geometry.js";import{QueryProviderBase as a}from"./QueryProviderBase.js";export class GeoJSONLayerClientSideQueryProvider extends a{isSupported(e){const{layer:t}=e;return r(t)}_query(t,r,a){const{layer:o}=t,i=o.createQuery();i.where=r,i.outFields=a.outFields,i.returnGeometry=a.returnGeometry??i.returnGeometry,i.outSpatialReference=a.outSpatialReference,i.maxAllowableOffset=a.maxAllowableOffset,i.returnZ=o.hasZ;let l=a.spatialFilter;return l&&(i.spatialRelationship="intersects",o.capabilities?.data?.supportsZ||(l=s(l.clone())),i.geometry=l),o.capabilities.query.supportsPagination&&(i.num=a.maxResults),e(i,t,o,a.cancelToken)}async _count(e,r,a){const{layer:o}=e,i=o.createQuery();i.where=r,i.outFields=a.outFields,i.returnGeometry=a.returnGeometry??i.returnGeometry;let l=a.spatialFilter;return l&&(i.spatialRelationship="intersects",l&&!o.capabilities?.data?.supportsZ&&(l=s(l.clone())),i.geometry=l),i.num=a.maxResults,t(i,e,o,a.cancelToken)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeQuery as e,executeCount as r,concatenateWhereClauses as t}from"../../support/_query.js";import{isSceneLayer as a}from"../../utilities/_layers.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class SceneLayerQueryProvider extends s{isSupported(e){const{layer:r}=e;return a(r)&&!!r.associatedLayer}_query(r,a,s){const{layer:
|
|
1
|
+
import{executeQuery as e,executeCount as r,concatenateWhereClauses as t}from"../../support/_query.js";import{isSceneLayer as a}from"../../utilities/_layers.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class SceneLayerQueryProvider extends s{isSupported(e){const{layer:r}=e;return a(r)&&!!r.associatedLayer}_query(r,a,s){const{layer:o}=r,i=o.associatedLayer.createQuery();return i.where=t(a,o.definitionExpression),i.outFields=s.outFields,i.returnGeometry=s.returnGeometry??i.returnGeometry,i.outSpatialReference=s.outSpatialReference,i.maxAllowableOffset=s.maxAllowableOffset,s.spatialFilter&&(i.spatialRelationship="intersects",i.geometry=s.spatialFilter),i.num=s.maxResults,i.returnZ=!0,e(i,r,o.associatedLayer,s.cancelToken)}async _count(e,t,a){const{layer:s}=e,o=s.associatedLayer.createQuery();return o.where=t,o.outFields=a.outFields,o.returnGeometry=a.returnGeometry??o.returnGeometry,a.spatialFilter&&(o.spatialRelationship="intersects",o.geometry=a.spatialFilter),o.num=a.maxResults,r(o,e,s.associatedLayer,a.cancelToken)}}
|