@arcgis/core 4.33.0-next.20250529 → 4.33.0-next.20250531
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/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
- package/applications/ExperienceBuilder/sketchUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d2317b87aa2ac3ad97a6.js → 1dc1084eb34748a35d35.js} +1 -1
- package/assets/esri/core/workers/chunks/{1573c017fd9fc0fe7527.js → 248a198f97871a8d6dd6.js} +1 -1
- package/assets/esri/core/workers/chunks/2c9a228d8e53d688fe5e.js +1 -0
- package/assets/esri/core/workers/chunks/{08583c74b8c538aef4d5.js → 346781f07389074f6c12.js} +1 -1
- package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +1 -0
- package/assets/esri/core/workers/chunks/a61fa2853307830ec577.js +1 -0
- package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → b6c3a2d93a59df9a1418.js} +1 -1
- package/assets/esri/core/workers/chunks/ba015f4f72714820a12f.js +1 -0
- package/assets/esri/core/workers/chunks/bbbd58b02a3ee8fe595e.js +1 -0
- package/assets/esri/core/workers/chunks/c3df693d1bce8f189fa2.js +1 -0
- package/assets/esri/core/workers/chunks/{355ab428a04ee9fcf888.js → e7bebf0d272cc3922982.js} +1 -1
- package/assets/esri/core/workers/chunks/{604d7250ed5e1edd59ac.js → f2863c501d62dece5fdd.js} +1 -1
- package/assets/esri/core/workers/chunks/{7112b092d98172b7db8b.js → f48eb59b94ba8b7d4d72.js} +1 -1
- package/assets/esri/core/workers/chunks/{b534a8d70018ce16400b.js → f9e1b73976027e17cd03.js} +1 -1
- package/assets/esri/core/workers/chunks/fe3832107278244dc04d.js +1 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/effects/FocusArea.js +1 -1
- package/interfaces.d.ts +46 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GroupLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/networks/CircuitManager.js +1 -1
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/unitIdentifiers/support/{QueryUnitIdentifiersParamters.js → QueryUnitIdentifiersParameters.js} +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/layers/CatalogFootprintLayerView.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/css.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/109e5635c1b9a0929d16.js +0 -1
- package/assets/esri/core/workers/chunks/3a6ddff13bd47ed11798.js +0 -1
- package/assets/esri/core/workers/chunks/5617532299f73d186968.js +0 -1
- package/assets/esri/core/workers/chunks/b763292829aa4d3fab60.js +0 -1
- package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +0 -1
- package/assets/esri/core/workers/chunks/c9fbada1e84981784f6c.js +0 -1
- package/assets/esri/core/workers/chunks/f0e7ca92f6d4d994337f.js +0 -1
package/effects/FocusArea.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import o from"../request.js";import r from"../core/Clonable.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import o from"../request.js";import r from"../core/Clonable.js";import t from"../core/JSONSupport.js";import{generateUUID as s}from"../core/uuid.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{persistable as a}from"../core/accessorSupport/decorators/persistable.js";import c from"./FocusAreaOutline.js";import l from"../layers/support/PolygonCollection.js";import{f as m}from"../chunks/persistableUrlUtils.js";let u=class extends(t.JSONSupportMixin(r)){constructor(e){super(e),this.id=`focusarea-${s()}`,this.title=null,this.enabled=!0,this.outline=null,this.geometries=new l}readGeometries(e,o,r){Array.isArray(e)?this.geometries=l.fromJSON(e,r):r.hooks?.onAfterLoad?.((()=>this._loadGeometries(m(e,r),r)))}async _loadGeometries(e,r){const t=await o(e,{responseType:"json"});this.geometries=l.fromJSON(t.data,r)}};e([i({type:String,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}}),i()],u.prototype,"id",void 0),e([i({type:String,json:{write:!0}})],u.prototype,"title",void 0),e([i({type:Boolean,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}})],u.prototype,"enabled",void 0),e([i({type:c,json:{write:!0}})],u.prototype,"outline",void 0),e([i({type:l,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}},clonable:e=>new l(e.items.map((e=>e.clone())))}),a({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],u.prototype,"geometries",void 0),e([p(["web-scene","portal-item"],"geometries")],u.prototype,"readGeometries",null),u=e([n("esri.effects.FocusArea")],u);const d=u;export{d as default};
|
package/interfaces.d.ts
CHANGED
|
@@ -1823,6 +1823,15 @@ declare namespace __esri {
|
|
|
1823
1823
|
* @param customActionOptions Options for the custom tools.
|
|
1824
1824
|
*/
|
|
1825
1825
|
setCustomTools(sketch: Sketch, createToolOptions?: sketchUtilsSetCustomToolsCreateToolOptions[] | nullish, customActionOptions?: sketchUtilsSetCustomToolsCustomActionOptions[] | nullish): Sketch;
|
|
1826
|
+
/**
|
|
1827
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1828
|
+
*
|
|
1829
|
+
* Configures the sketch widget's group collapse behavior.
|
|
1830
|
+
*
|
|
1831
|
+
* @param sketch Reference to the sketch widget to configure.
|
|
1832
|
+
* @param options Group collapse options.
|
|
1833
|
+
*/
|
|
1834
|
+
setGroupAllowCollapse(sketch: Sketch, options: globalThis.Map<"selectionTools" | "selectionSet" | "createTools" | "undoRedo" | "settings", boolean>): Sketch;
|
|
1826
1835
|
/**
|
|
1827
1836
|
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1828
1837
|
*
|
|
@@ -3350,7 +3359,7 @@ declare namespace __esri {
|
|
|
3350
3359
|
*/
|
|
3351
3360
|
interface config {
|
|
3352
3361
|
apiKey: string | nullish;
|
|
3353
|
-
apiKeys:
|
|
3362
|
+
apiKeys: configApiKeys;
|
|
3354
3363
|
applicationName: string;
|
|
3355
3364
|
assetsPath: string;
|
|
3356
3365
|
fontsUrl: string;
|
|
@@ -3370,6 +3379,16 @@ declare namespace __esri {
|
|
|
3370
3379
|
export type AfterInterceptorCallback = (response: RequestResponse) => void;
|
|
3371
3380
|
export type BeforeInterceptorCallback = (params: BeforeInterceptorCallbackParams) => any;
|
|
3372
3381
|
|
|
3382
|
+
export interface configApiKeys {
|
|
3383
|
+
basemapStyles?: string;
|
|
3384
|
+
scopes?: configApiKeysScopes[];
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
export interface configApiKeysScopes {
|
|
3388
|
+
token?: string;
|
|
3389
|
+
urls?: RegExp | string | (RegExp | string)[];
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3373
3392
|
export interface configLog {
|
|
3374
3393
|
interceptors: LogInterceptor[];
|
|
3375
3394
|
level: "none" | "error" | "info" | "warn" | nullish;
|
|
@@ -4755,6 +4774,12 @@ declare namespace __esri {
|
|
|
4755
4774
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-effects-FocusArea.html#id Read more...}
|
|
4756
4775
|
*/
|
|
4757
4776
|
id: string;
|
|
4777
|
+
/**
|
|
4778
|
+
* The title of the focus area.
|
|
4779
|
+
*
|
|
4780
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-effects-FocusArea.html#title Read more...}
|
|
4781
|
+
*/
|
|
4782
|
+
title: string | nullish;
|
|
4758
4783
|
/**
|
|
4759
4784
|
* A class representing a single focus area.
|
|
4760
4785
|
*
|
|
@@ -4824,6 +4849,12 @@ declare namespace __esri {
|
|
|
4824
4849
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-effects-FocusArea.html#outline Read more...}
|
|
4825
4850
|
*/
|
|
4826
4851
|
outline?: FocusAreaOutlineProperties | nullish;
|
|
4852
|
+
/**
|
|
4853
|
+
* The title of the focus area.
|
|
4854
|
+
*
|
|
4855
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-effects-FocusArea.html#title Read more...}
|
|
4856
|
+
*/
|
|
4857
|
+
title?: string | nullish;
|
|
4827
4858
|
}
|
|
4828
4859
|
|
|
4829
4860
|
export interface FocusAreaOutline extends Accessor, JSONSupport, Clonable {
|
|
@@ -107506,6 +107537,13 @@ declare namespace __esri {
|
|
|
107506
107537
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html#timeZone Read more...}
|
|
107507
107538
|
*/
|
|
107508
107539
|
timeZone: string | nullish;
|
|
107540
|
+
/**
|
|
107541
|
+
* Indicates whether there are any validation errors for any fields for any
|
|
107542
|
+
* features.
|
|
107543
|
+
*
|
|
107544
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html#valid Read more...}
|
|
107545
|
+
*/
|
|
107546
|
+
readonly valid: boolean;
|
|
107509
107547
|
/**
|
|
107510
107548
|
* The view model for this widget.
|
|
107511
107549
|
*
|
|
@@ -107518,6 +107556,12 @@ declare namespace __esri {
|
|
|
107518
107556
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html Read more...}
|
|
107519
107557
|
*/
|
|
107520
107558
|
constructor(properties?: BatchAttributeFormProperties);
|
|
107559
|
+
/**
|
|
107560
|
+
* Fires the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html#event-submit submit} event.
|
|
107561
|
+
*
|
|
107562
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html#submit Read more...}
|
|
107563
|
+
*/
|
|
107564
|
+
submit(): void;
|
|
107521
107565
|
}
|
|
107522
107566
|
|
|
107523
107567
|
interface BatchAttributeFormProperties extends WidgetProperties {
|
|
@@ -107585,6 +107629,7 @@ declare namespace __esri {
|
|
|
107585
107629
|
interface BatchAttributeFormViewModel {
|
|
107586
107630
|
map: Map | nullish;
|
|
107587
107631
|
readOnly: boolean;
|
|
107632
|
+
readonly valid: boolean;
|
|
107588
107633
|
/**
|
|
107589
107634
|
* Convenience method to find field inputs.
|
|
107590
107635
|
*
|
package/layers/CatalogLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{urlToObject as n,join as l,hasSamePortal as p}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import m from"./Layer.js";import u from"./catalog/CatalogDynamicGroupLayer.js";import c from"./catalog/CatalogFootprintLayer.js";import h from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as F}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as w}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as L}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as v}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{OrderedLayer as x}from"./mixins/OrderedLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{RefreshableLayer as O}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as E}from"./mixins/TemporalLayer.js";import{legendEnabled as T,id as _}from"./support/commonProperties.js";import{ensureLayerCredential as P,applyEdits as C,getFeatureType as G,hasDataChanged as U}from"./support/featureLayerUtils.js";import q from"./support/FeatureType.js";import{defineFieldProperties as A}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as D}from"./support/versionUtils.js";import Q from"../portal/Portal.js";import N from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as M}from"../portal/support/urlUtils.js";import R from"../rest/support/Query.js";const B=A();function V(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}function k(e){return"object"==typeof e&&null!=e&&"url"in e}function J(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]}function K(e,t,r,i){const o=e.write({},i);J(o)||(t[r]=o)}let H=class extends(w(v(L(F(x(E(b(O(g(S(I(s(j(f(m))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new u({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new c({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new r([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new h({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(a).then((async()=>{const{url:e,source:r,portalItem:o}=this;if(!e)throw new i("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new i("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t});const{sourceJSON:s}=r;s&&(this.sourceJSON=s,this.read(s,{origin:"service",portalItem:o,portal:o?.portal,url:this.parsedUrl}))})).then((()=>{const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter((e=>!this.fieldsIndex.has(e)));if(t.length)throw new i("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})})).then((()=>P(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=n(this.url);return null!=e&&null!=this.layerId&&(e.path=l(e.path,this.layerId.toString())),e}async applyEdits(e,t){return C(this,e,t)}on(e,t){return super.on(e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new R,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return G(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async hasDataChanged(){return U(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(R.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r.footprintLayer;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(R.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(R.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(R.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&D(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(r?.layers))return r.layers.find((({type:e})=>this.supportedSourceTypes.has(e)))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new i("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const r=JSON.parse(t);if(V(r)){const{itemId:e,portalUrl:t}=r,i=M(t),s=this.portalItem?.portal,a=Q.getDefault();let n,l=!0;s&&p(t,s.url)?n=s:p(t,a.url)?n=a:(n=o(this._portals,i,(()=>new Q({url:i}))),l=!1);const d=await m.fromPortalItem(new N({id:e,portal:n}));return l||await W(d),d}if(k(r))return m.fromArcGISServerUrl({url:r.url});const{default:s}=await import("./UnsupportedLayer.js");return new s}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const o=t.getAttribute(this.minScaleField);null!=o&&"minScale"in e&&(e.minScale=o)}};async function W(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map((e=>W(e))),...e.tables.map((e=>W(e)))])}}e([d(T)],H.prototype,"legendEnabled",void 0),e([d({readOnly:!0})],H.prototype,"createQueryVersion",null),e([d({readOnly:!0})],H.prototype,"drawOrderField",void 0),e([d({type:u,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:K}}})],H.prototype,"dynamicGroupLayer",void 0),e([d({readOnly:!0})],H.prototype,"editingEnabled",null),e([d({readOnly:!0})],H.prototype,"effectiveEditingEnabled",null),e([d({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],H.prototype,"elevationInfo",void 0),e([d({...B.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],H.prototype,"fields",void 0),e([d(B.fieldsIndex)],H.prototype,"fieldsIndex",void 0),e([d({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],H.prototype,"floorInfo",void 0),e([d({type:c,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:K}}})],H.prototype,"footprintLayer",void 0),e([d(_)],H.prototype,"id",void 0),e([d({readOnly:!0})],H.prototype,"itemNameField",void 0),e([d({readOnly:!0})],H.prototype,"itemSourceField",void 0),e([d({readOnly:!0})],H.prototype,"itemTypeField",void 0),e([d({readOnly:!0})],H.prototype,"layers",void 0),e([d({type:["show","hide","hide-children"]})],H.prototype,"listMode",void 0),e([d({readOnly:!0})],H.prototype,"maxScaleField",void 0),e([d({readOnly:!0})],H.prototype,"minScaleField",void 0),e([d({value:"CatalogLayer",type:["CatalogLayer"]})],H.prototype,"operationalLayerType",void 0),e([d({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],H.prototype,"orderBy",void 0),e([d(B.outFields)],H.prototype,"outFields",void 0),e([d({readOnly:!0})],H.prototype,"parsedUrl",null),e([d({readOnly:!0})],H.prototype,"source",void 0),e([d({json:{read:!1}})],H.prototype,"type",void 0),e([d({type:String})],H.prototype,"typeIdField",void 0),e([d({type:[q]})],H.prototype,"types",void 0),H=e([y("esri.layers.CatalogLayer")],H);const $=H;export{$ as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{urlToObject as n,join as l,hasSamePortal as p}from"../core/urlUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import u from"./Layer.js";import m from"./catalog/CatalogDynamicGroupLayer.js";import c from"./catalog/CatalogFootprintLayer.js";import f from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as L}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as v}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{OrderedLayer as b}from"./mixins/OrderedLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as E}from"./mixins/TemporalLayer.js";import{legendEnabled as T,id as _}from"./support/commonProperties.js";import{ensureLayerCredential as P,applyEdits as q,getFeatureType as C,hasDataChanged as A,validateBinsQuery as G}from"./support/featureLayerUtils.js";import U from"./support/FeatureType.js";import{defineFieldProperties as B}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as Q}from"./support/versionUtils.js";import D from"../portal/Portal.js";import N from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as M}from"../portal/support/urlUtils.js";import R from"../rest/support/Query.js";const V=B();function k(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}function J(e){return"object"==typeof e&&null!=e&&"url"in e}function K(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]}function H(e,t,r,i){const o=e.write({},i);K(o)||(t[r]=o)}let W=class extends(F(v(L(j(b(E(O(I(g(S(x(s(w(h(u))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new m({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new c({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new r([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new f({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(a).then((async()=>{const{url:e,source:r,portalItem:o}=this;if(!e)throw new i("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new i("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t});const{sourceJSON:s}=r;s&&(this.sourceJSON=s,this.read(s,{origin:"service",portalItem:o,portal:o?.portal,url:this.parsedUrl}))})).then((()=>{const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter((e=>!this.fieldsIndex.has(e)));if(t.length)throw new i("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})})).then((()=>P(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=n(this.url);return null!=e&&null!=this.layerId&&(e.path=l(e.path,this.layerId.toString())),e}async applyEdits(e,t){return q(this,e,t)}on(e,t){return super.on(e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new R,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return C(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async hasDataChanged(){return A(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(R.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r.footprintLayer;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(R.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(R.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(R.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&Q(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async queryAttributeBins(e,t){const{source:r,capabilities:o}=await this.load(),s="CatalogLayer";if(!r.queryAttributeBins||!o?.operations?.supportsQueryBins)throw new i(s,"The layer does not support queryAttributeBins");G(e,o,s);const a=await import("../rest/support/AttributeBinsQuery.js"),n=await r.queryAttributeBins(a.default.from(e),t);if(n.features)for(const i of n.features)i.layer=i.sourceLayer=this.footprintLayer;return n}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(r?.layers))return r.layers.find((({type:e})=>this.supportedSourceTypes.has(e)))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new i("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const r=JSON.parse(t);if(k(r)){const{itemId:e,portalUrl:t}=r,i=M(t),s=this.portalItem?.portal,a=D.getDefault();let n,l=!0;s&&p(t,s.url)?n=s:p(t,a.url)?n=a:(n=o(this._portals,i,(()=>new D({url:i}))),l=!1);const y=await u.fromPortalItem(new N({id:e,portal:n}));return l||await $(y),y}if(J(r))return u.fromArcGISServerUrl({url:r.url});const{default:s}=await import("./UnsupportedLayer.js");return new s}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const o=t.getAttribute(this.minScaleField);null!=o&&"minScale"in e&&(e.minScale=o)}};async function $(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map((e=>$(e))),...e.tables.map((e=>$(e)))])}}e([y(T)],W.prototype,"legendEnabled",void 0),e([y({readOnly:!0})],W.prototype,"createQueryVersion",null),e([y({readOnly:!0})],W.prototype,"drawOrderField",void 0),e([y({type:m,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:H}}})],W.prototype,"dynamicGroupLayer",void 0),e([y({readOnly:!0})],W.prototype,"editingEnabled",null),e([y({readOnly:!0})],W.prototype,"effectiveEditingEnabled",null),e([y({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],W.prototype,"elevationInfo",void 0),e([y({...V.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],W.prototype,"fields",void 0),e([y(V.fieldsIndex)],W.prototype,"fieldsIndex",void 0),e([y({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],W.prototype,"floorInfo",void 0),e([y({type:c,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:H}}})],W.prototype,"footprintLayer",void 0),e([y(_)],W.prototype,"id",void 0),e([y({readOnly:!0})],W.prototype,"itemNameField",void 0),e([y({readOnly:!0})],W.prototype,"itemSourceField",void 0),e([y({readOnly:!0})],W.prototype,"itemTypeField",void 0),e([y({readOnly:!0})],W.prototype,"layers",void 0),e([y({type:["show","hide","hide-children"]})],W.prototype,"listMode",void 0),e([y({readOnly:!0})],W.prototype,"maxScaleField",void 0),e([y({readOnly:!0})],W.prototype,"minScaleField",void 0),e([y({value:"CatalogLayer",type:["CatalogLayer"]})],W.prototype,"operationalLayerType",void 0),e([y({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],W.prototype,"orderBy",void 0),e([y(V.outFields)],W.prototype,"outFields",void 0),e([y({readOnly:!0})],W.prototype,"parsedUrl",null),e([y({readOnly:!0})],W.prototype,"source",void 0),e([y({json:{read:!1}})],W.prototype,"type",void 0),e([y({type:String})],W.prototype,"typeIdField",void 0),e([y({type:[U]})],W.prototype,"types",void 0),W=e([d("esri.layers.CatalogLayer")],W);const z=W;export{z as default};
|
package/layers/GeoJSONLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import{MultiOriginJSONMixin as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../core/Error.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as i}from"../core/promiseUtils.js";import{urlToObject as s}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"../geometry/Extent.js";import l from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as u}from"../geometry/support/typeUtils.js";import d from"./Layer.js";import{GeoJSONSource as m}from"./graphics/sources/GeoJSONSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as c}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as h}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as f}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as j}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{OrderedLayer as b}from"./mixins/OrderedLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as F}from"./mixins/TemporalLayer.js";import{TrackableLayer as O}from"./mixins/TrackableLayer.js";import{attributeTableTemplate as T,elevationInfo as w,id as E,labelsVisible as S,legendEnabled as L,opacity as P,popupEnabled as q,screenSizePerspectiveEnabled as U,url as D}from"./support/commonProperties.js";import{validateBinsQuery as J}from"./support/featureLayerUtils.js";import N from"./support/FeatureTemplate.js";import Q from"./support/Field.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{fixRendererFields as B,fixTimeInfoFields as G}from"./support/fieldUtils.js";import C from"./support/LabelClass.js";import{reader as Z}from"./support/labelingInfo.js";import{webSceneRendererTypes as A,rendererTypes as V}from"../renderers/support/typeUtils.js";import _ from"../rest/support/Query.js";import{createPopupTemplate as M}from"../support/popupUtils.js";import{timeZoneProperty as k}from"../time/timeZoneUtils.js";const z=R();let W=class extends(b(h(c(j(f(y(F(O(I(x(g(v(o(d)))))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new m({layer:this}),this.spatialReference=l.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(i).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),B(this.renderer,this.fieldsIndex),G(this.timeInfo,this.fieldsIndex)}));return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}get parsedUrl(){return this.url?s(this.url):null}set renderer(e){B(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=s(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");await this.load();const o=await r(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),o}on(e,t){return super.on(e,t)}createPopupTemplate(e){return M(this,e)}createQuery(){const e=new _,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:o}=this;return e.timeExtent=null!=r&&null!=o?o.offset(-r.value,r.unit):o||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(_.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(_.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(_.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(_.from(e)||this.createQuery(),t)))}async queryAttributeBins(e,t){const{source:o,capabilities:i}=await this.load(),s="GeoJSONLayer";if(!o.queryAttributeBins||!i?.operations?.supportsQueryBins)throw new r(s,"Layer source does not support queryAttributeBins capability");J(e,i,s);const p=await import("../rest/support/AttributeBinsQuery.js"),n=await o.queryAttributeBins(p.default.from(e),t);if(n.features)for(const r of n.features)r.layer=r.sourceLayer=this;return n}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([p(T)],W.prototype,"attributeTableTemplate",void 0),e([p({readOnly:!0,json:{read:!1,write:!1}})],W.prototype,"capabilities",null),e([p({type:String})],W.prototype,"copyright",void 0),e([p({readOnly:!0})],W.prototype,"createQueryVersion",null),e([p(k("dateFieldsTimeReference"))],W.prototype,"dateFieldsTimeZone",void 0),e([p({readOnly:!0})],W.prototype,"defaultPopupTemplate",null),e([p({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],W.prototype,"definitionExpression",void 0),e([p({type:String})],W.prototype,"displayField",void 0),e([p({type:Boolean})],W.prototype,"editingEnabled",void 0),e([p(w)],W.prototype,"elevationInfo",void 0),e([p({type:[Q],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],W.prototype,"fields",void 0),e([p(z.fieldsIndex)],W.prototype,"fieldsIndex",void 0),e([p({type:a,json:{name:"extent"}})],W.prototype,"fullExtent",void 0),e([p({type:["point","polygon","polyline","multipoint"],json:{read:{reader:u.read}}})],W.prototype,"geometryType",void 0),e([p({type:Boolean})],W.prototype,"hasZ",void 0),e([p(E)],W.prototype,"id",void 0),e([p({type:Boolean,readOnly:!0})],W.prototype,"isTable",null),e([p(S)],W.prototype,"labelsVisible",void 0),e([p({type:[C],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Z},write:!0}})],W.prototype,"labelingInfo",void 0),e([p(L)],W.prototype,"legendEnabled",void 0),e([p({type:["show","hide"]})],W.prototype,"listMode",void 0),e([p({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],W.prototype,"objectIdField",void 0),e([p(P)],W.prototype,"opacity",void 0),e([p({type:["GeoJSON"]})],W.prototype,"operationalLayerType",void 0),e([p(z.outFields)],W.prototype,"outFields",void 0),e([p({readOnly:!0})],W.prototype,"parsedUrl",null),e([p(q)],W.prototype,"popupEnabled",void 0),e([p({type:t,json:{name:"popupInfo",write:!0}})],W.prototype,"popupTemplate",void 0),e([p({types:V,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:A}}}})],W.prototype,"renderer",null),e([p(U)],W.prototype,"screenSizePerspectiveEnabled",void 0),e([p({readOnly:!0})],W.prototype,"source",void 0),e([p({type:l})],W.prototype,"spatialReference",void 0),e([p({type:[N]})],W.prototype,"templates",void 0),e([p()],W.prototype,"title",void 0),e([p({json:{read:!1},readOnly:!0})],W.prototype,"type",void 0),e([p(D)],W.prototype,"url",null),W=e([n("esri.layers.GeoJSONLayer")],W);const H=W;export{H as default};
|
package/layers/GroupLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/CollectionFlattener.js";import{loadAll as t}from"../core/loadAll.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as o,throwIfAbortError as a}from"../core/promiseUtils.js";import{watch as l,syncAndInitial as p,on as n,sync as d}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as c}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../core/accessorSupport/decorators/writer.js";import{OriginId as b}from"../core/accessorSupport/PropertyOrigin.js";import v from"./Layer.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{populateGroupLayer as w}from"./support/layersCreator.js";import{layerLookupMap as S}from"./support/lazyLayerLoader.js";import _ from"../portal/PortalItem.js";import{createFlattenedTablesCollection as I}from"../support/collectionUtils.js";import{LayersMixin as O}from"../support/LayersMixin.js";import{TablesMixin as M}from"../support/TablesMixin.js";import{WebSceneTag as x}from"../support/tagSymbols.js";import{SaveOperationType as P}from"../webdoc/interfaces.js";import{beforeSave as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/CollectionFlattener.js";import{loadAll as t}from"../core/loadAll.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as o,throwIfAbortError as a}from"../core/promiseUtils.js";import{watch as l,syncAndInitial as p,on as n,sync as d}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as c}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../core/accessorSupport/decorators/writer.js";import{OriginId as b}from"../core/accessorSupport/PropertyOrigin.js";import v from"./Layer.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{populateGroupLayer as w}from"./support/layersCreator.js";import{layerLookupMap as S}from"./support/lazyLayerLoader.js";import _ from"../portal/PortalItem.js";import{createFlattenedTablesCollection as I}from"../support/collectionUtils.js";import{LayersMixin as O}from"../support/LayersMixin.js";import{TablesMixin as M}from"../support/TablesMixin.js";import{WebSceneTag as x}from"../support/tagSymbols.js";import{SaveOperationType as P}from"../webdoc/interfaces.js";import{beforeSave as V}from"../webdoc/support/saveUtils.js";import{getLayerJSON as A}from"../webdoc/support/writeUtils.js";let C=class extends(f(g(j(L(M(O(s(v)))))))){constructor(e){super(e),this.allLayers=new r({getCollections:()=>[this.layers],getChildrenFunction:e=>"layers"in e?e.layers:null}),this.allTables=I(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=o((async(e,r,t)=>{const{save:i,saveAs:s}=await import("./save/groupLayerUtils.js");switch(e){case P.SAVE:return i(this,r);case P.SAVE_AS:return s(this,t,r)}}))}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([l((()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&x in e}),(e=>{const r="prevent-adding-tables";this.removeHandles(r),e&&(this.tables.removeAll(),this.addHandles(n((()=>this.tables),"before-add",(e=>{e.preventDefault(),i.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")})),r))}),p),l((()=>this.visible),this._onVisibilityChange.bind(this),d)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===b.USER}_writeLayers(e,r,t,i){const s=[];if(!e)return s;e.forEach((e=>{const r=A(e,i.webmap?i.webmap.getLayerJSONFromResourceInfo(e):null,i);r?.layerType&&s.push(r)})),r.layers=s}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,r,t){const{itemId:i,layerType:s}=r;if("GroupLayer"===s&&i)return new _({id:i,portal:t?.portal})}writePortalItem(e,r){e?.id&&(r.itemId=e.id)}set visibilityMode(e){const r=this._get("visibilityMode")!==e;this._set("visibilityMode",e),r&&this._enforceVisibility(e,this.visible)}async beforeSave(){return V(this)}load(e){const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service","Video Service"],layerModuleTypeMap:S,populateGroupLayer:w},e).catch((e=>{if(a(e),this.sourceIsPortalItem)throw e}));return this.addResolvingPromise(r),Promise.resolve(this)}async loadAll(){return t(this,(e=>{e(this.layers,this.tables)}))}async save(e){return this._debouncedSaveOperations(P.SAVE,e)}async saveAs(e,r){return this._debouncedSaveOperations(P.SAVE_AS,r,e)}layerAdded(e){e.visible&&"exclusive"===this.visibilityMode?this._turnOffOtherLayers(e):"inherited"===this.visibilityMode&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(l((()=>e.visible),(r=>this._onChildVisibilityChange(e,r)),d),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach((r=>{r!==e&&(r.visible=!1)}))}_enforceVisibility(e,r){if(!c(this).initialized)return;const t=this.layers;let i=t.find((e=>e.visible));switch(e){case"exclusive":t.length&&!i&&(i=t.at(0),i.visible=!0),this._turnOffOtherLayers(i);break;case"inherited":t.forEach((e=>{e.visible=r}))}}_onVisibilityChange(e){"inherited"===this.visibilityMode&&this.layers.forEach((r=>{r.visible=e}))}_onChildVisibilityChange(e,r){switch(this.visibilityMode){case"exclusive":r?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some((e=>e.visible))}};e([y({readOnly:!0,dependsOn:[]})],C.prototype,"allLayers",void 0),e([y({readOnly:!0})],C.prototype,"allTables",void 0),e([y({json:{read:!0,write:!0}})],C.prototype,"blendMode",void 0),e([y()],C.prototype,"fullExtent",void 0),e([y({readOnly:!0})],C.prototype,"sourceIsPortalItem",null),e([y({json:{read:!1,write:{ignoreOrigin:!0}}})],C.prototype,"layers",void 0),e([u("layers")],C.prototype,"_writeLayers",null),e([y({type:["GroupLayer"]})],C.prototype,"operationalLayerType",void 0),e([y({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,r,t){return{enabled:"Group Layer"===e?.type&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],C.prototype,"portalItem",null),e([m("web-map","portalItem",["itemId"])],C.prototype,"readPortalItem",null),e([u("web-map","portalItem",{itemId:{type:String}})],C.prototype,"writePortalItem",null),e([y()],C.prototype,"spatialReference",void 0),e([y({json:{read:!1},readOnly:!0,value:"group"})],C.prototype,"type",void 0),e([y({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,r,t)=>{"inherited"!==e&&(r[t]=e)}}}}})],C.prototype,"visibilityMode",null),C=e([h("esri.layers.GroupLayer")],C);const E=C;export{E as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import r from"../PopupTemplate.js";import{MultiOriginJSONMixin as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import r from"../PopupTemplate.js";import t from"../core/Error.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/Extent.js";import p from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as l}from"../geometry/support/typeUtils.js";import a from"./Layer.js";import{OGCFeatureSource as d}from"./graphics/sources/OGCFeatureSource.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as c}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as f}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as h}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{OrderedLayer as j}from"./mixins/OrderedLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RefreshableLayer as b}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{TrackableLayer as L}from"./mixins/TrackableLayer.js";import{elevationInfo as F,labelsVisible as S,legendEnabled as O,popupEnabled as w,screenSizePerspectiveEnabled as T,url as R}from"./support/commonProperties.js";import C from"./support/FeatureType.js";import D from"./support/Field.js";import{defineFieldProperties as P}from"./support/fieldProperties.js";import{fixRendererFields as E,fixTimeInfoFields as G}from"./support/fieldUtils.js";import _ from"./support/LabelClass.js";import{reader as q}from"./support/labelingInfo.js";import{webSceneRendererTypes as B,rendererTypes as M}from"../renderers/support/typeUtils.js";import U from"../rest/support/Query.js";import{createPopupTemplate as A}from"../support/popupUtils.js";const N=P();let Q=class extends(c(y(u(h(f(m(j(I(L(x(g(v(b(i(a))))))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then((()=>this._fetchService(e)))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&null==this.geometryType}set renderer(e){E(e,this.fieldsIndex),this._set("renderer",e)}on(e,r){return super.on(e,r)}createPopupTemplate(e){return A(this,e)}createQuery(){return new U}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){let t,i=!1;const o=r?.feature?.attributes,s=this.typeIdField&&o?.[this.typeIdField];return null!=s&&this.types&&(i=this.types.some((r=>r.id==s&&(t=r.domains?.[e],"inherited"===t?.type&&(t=this._getLayerDomain(e)),!0)))),i||t||(t=this._getLayerDomain(e)),t}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(U.from(e)||this.createQuery(),r))).then((e=>(e?.features?.forEach((e=>{e.layer=e.sourceLayer=this})),e)))}async queryAttributeBins(e,r){throw new t("OGCFeatureLayer","Layer source does not support queryAttributeBins capability")}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),E(this.renderer,this.fieldsIndex),G(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const r of this.fields)if(r.name===e&&r.domain)return r.domain;return null}};e([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],Q.prototype,"capabilities",void 0),e([o({type:String,json:{write:!0}})],Q.prototype,"collectionId",void 0),e([o({type:String})],Q.prototype,"copyright",void 0),e([o({readOnly:!0})],Q.prototype,"defaultPopupTemplate",null),e([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],Q.prototype,"description",void 0),e([o({type:String})],Q.prototype,"displayField",void 0),e([o({type:Number})],Q.prototype,"effectiveMaxRecordCount",null),e([o(F)],Q.prototype,"elevationInfo",void 0),e([o({type:[D],json:{origins:{service:{name:"layerDefinition.fields"}}}})],Q.prototype,"fields",void 0),e([o(N.fieldsIndex)],Q.prototype,"fieldsIndex",void 0),e([o({readOnly:!0,type:n,json:{origins:{service:{name:"layerDefinition.extent"}}}})],Q.prototype,"fullExtent",void 0),e([o({type:l.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:l.read}}}}})],Q.prototype,"geometryType",void 0),e([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],Q.prototype,"hasZ",void 0),e([o({type:Boolean,readOnly:!0})],Q.prototype,"isTable",null),e([o({type:[_],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:q},write:!0}}}})],Q.prototype,"labelingInfo",void 0),e([o(S)],Q.prototype,"labelsVisible",void 0),e([o(O)],Q.prototype,"legendEnabled",void 0),e([o({type:Number})],Q.prototype,"maxRecordCount",void 0),e([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],Q.prototype,"objectIdField",void 0),e([o({type:["OGCFeatureLayer"]})],Q.prototype,"operationalLayerType",void 0),e([o(w)],Q.prototype,"popupEnabled",void 0),e([o({type:r,json:{name:"popupInfo",write:!0}})],Q.prototype,"popupTemplate",void 0),e([o({types:M,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],Q.prototype,"renderer",null),e([o(T)],Q.prototype,"screenSizePerspectiveEnabled",void 0),e([o({readOnly:!0})],Q.prototype,"source",void 0),e([o({readOnly:!0,type:p,json:{origins:{service:{read:!0}}}})],Q.prototype,"spatialReference",void 0),e([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],Q.prototype,"title",void 0),e([o({readOnly:!0,json:{read:!1}})],Q.prototype,"type",void 0),e([o({type:String,readOnly:!0})],Q.prototype,"typeIdField",void 0),e([o({type:[C]})],Q.prototype,"types",void 0),e([o(R)],Q.prototype,"url",void 0),Q=e([s("esri.layers.OGCFeatureLayer")],Q);const V=Q;export{V as default};
|
package/layers/RouteLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import i from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{isAbortError as u}from"../core/promiseUtils.js";import{on as p}from"../core/reactiveUtils.js";import{convertUnit as c}from"../core/unitUtils.js";import{urlToObject as m}from"../core/urlUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as w}from"../core/accessorSupport/originUtils.js";import g from"../geometry/Extent.js";import S from"../geometry/Multipoint.js";import{initializeProjection as b,project as v}from"../geometry/projectionUtils.js";import B from"../geometry/SpatialReference.js";import{wgs84 as P}from"../geometry/support/spatialReferenceUtils.js";import I from"./Layer.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{OperationalLayer as N}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as _}from"./support/arcgisLayerUrl.js";import L from"./support/RouteSymbols.js";import O from"../portal/Portal.js";import R from"../portal/PortalItem.js";import{typeKeyword as T}from"../portal/support/portalItemUtils.js";import{read as F}from"../renderers/support/jsonUtils.js";import{fetchServiceDescription as A}from"../rest/networkService.js";import{solve as k}from"../rest/route.js";import x from"../rest/support/DirectionLine.js";import G from"../rest/support/DirectionPoint.js";import J from"../rest/support/PointBarrier.js";import M from"../rest/support/PolygonBarrier.js";import E from"../rest/support/PolylineBarrier.js";import U from"../rest/support/RouteInfo.js";import W from"../rest/support/RouteParameters.js";import q from"../rest/support/RouteSettings.js";import V from"../rest/support/Stop.js";function Y(e){if(!e.length)return;const t=e.toArray(),r=t.map((({objectId:e})=>e)).filter((e=>null!=e));let o=Math.max(...r,0);for(const i of t)null==i.objectId&&(i.objectId=++o)}function Z(e,t){return!!e.length&&e.length===t.length&&z(e)&&z(t)}function z(e){return e.every((({objectId:e})=>null!=e))}function K(e){return e.length?e:null}function X(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:X("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:X("esriGeometryPolyline")}}}function H(e){return"layers"in e}function Q(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function $(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function ee(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.addedCost=r.addedCost,e.barrierType=r.barrierType,e.costs=r.costs,e.curbApproach=r.curbApproach,e.fullEdge=r.fullEdge,e.geometry=r.geometry,e.name=r.name,e.sideOfEdge=r.sideOfEdge,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol)}}function te(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function re(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function oe(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.arriveCurbApproach=r.arriveCurbApproach,e.arriveTime=r.arriveTime,e.arriveTimeOffset=r.arriveTimeOffset,e.cumulativeCosts=r.cumulativeCosts,e.cumulativeDistance=r.cumulativeDistance,e.cumulativeDuration=r.cumulativeDuration,e.curbApproach=r.curbApproach,e.departCurbApproach=r.departCurbApproach,e.departTime=r.departTime,e.departTimeOffset=r.departTimeOffset,e.distanceToNetworkInMeters=r.distanceToNetworkInMeters,e.geometry=r.geometry,e.lateDuration=r.lateDuration,e.name=r.name,e.navLatency=r.navLatency,e.posAlong=r.posAlong,e.routeName=r.routeName,e.serviceCosts=r.serviceCosts,e.serviceDistance=r.serviceDistance,e.serviceDuration=r.serviceDuration,e.sequence=r.sequence,e.sideOfEdge=r.sideOfEdge,e.snapX=r.snapX,e.snapY=r.snapY,e.snapZ=r.snapZ,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol,e.timeWindowEnd=r.timeWindowEnd,e.timeWindowStart=r.timeWindowStart,e.violations=r.violations,e.waitDuration=r.waitDuration,e.wait=r.wait)}}async function ie(e){const t=B.WGS84;return await b(e.spatialReference,t),v(e,t)}function se(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ne(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:c(e,t,"meters")}function ae(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const le=i.ofType(x),ue=i.ofType(G),pe=i.ofType(J),ce=i.ofType(M),me=i.ofType(E),ye=i.ofType(V);let fe=class extends(j(C(N(D(a(I)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.checksum=null,this.defaultSymbols=new L,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new pe,this.polygonBarriers=new ce,this.polylineBarriers=new me,this.routeInfo=null,this.spatialReference=B.WGS84,this.stops=new ye,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(p((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";l(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>x.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>G.fromGraphic(e)))}get fullExtent(){const e=new g({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:B.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter((e=>null!=e.geometry));if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new S({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.maxScale));return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.minScale));return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>J.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>M.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>E.fromGraphic(e)))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",(e=>U.fromGraphic(e))).at(0)??null}readSpatialReference(e,t){const r=H(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return B.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??P;return B.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>V.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",_(e,n.getLogger(this))):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new s("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new s("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new s("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(null==this.routeInfo)throw new s("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new s("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const n={messages:[],origin:"portal-item",portal:r,url:o?m(o):void 0,writtenProperties:[]},a=this.write(void 0,n);return t.extent=await ie(e),t.title=this.title,await t.update({data:a}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new s("routelayer:route-unsolved","saveAs() requires a solved route");const r=R.from(e).clone();r.extent??=await ie(this.fullExtent),r.id=null,r.portal??=O.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",T.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o.signIn();const n=t?.folder,a=this.write(void 0,i);return await o.user.addItem({item:r,folder:n,data:a}),this.portalItem=r,w(i),i.portalItem=r,r}async solve(e,t){Y(this.stops),Y(this.pointBarriers),Y(this.polylineBarriers),Y(this.polygonBarriers);const r=e?.stops??this.stops,o=e?.pointBarriers??K(this.pointBarriers),n=e?.polylineBarriers??K(this.polylineBarriers),a=e?.polygonBarriers??K(this.polygonBarriers);if(null==r)throw new s("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((Q(r)||$(r))&&r.features.length<2||i.isCollection(r)&&r.length<2)throw new s("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(i.isCollection(r))for(const i of r)i.routeName=null;const l=e?.apiKey,{checksum:p,url:c}=this,m=await this._getServiceDescription(c,l,t),y=e?.travelMode??m.defaultTravelMode,f=e?.accumulateAttributes??[];y&&(f.push(y.distanceAttributeName),y.timeAttributeName&&f.push(y.timeAttributeName));const d={accumulateAttributes:f,checksum:p,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:n,polygonBarriers:a,preserveObjectID:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:r},h=W.from(e??{});let w;h.set(d);try{w=await k(c,h,t)}catch(S){throw u(S)?S:new s("routelayer:failed-route-request","the routing request failed",{error:S})}const g=this._toRouteLayerSolution(w);return this._isOverridden("title")||(this.title=g.routeInfo.name??"Route"),this._populatePortalFields(g,m,h),g}update(e){const{checksum:t,directionLines:r,directionPoints:o,pointBarriers:i,polygonBarriers:s,polylineBarriers:n,routeInfo:a,stops:l}=e;Z(l,this.stops)?oe(l,this.stops):this.set({stops:l}),Z(i,this.pointBarriers)?ee(i,this.pointBarriers):this.set({pointBarriers:i}),Z(n,this.polylineBarriers)?te(n,this.polylineBarriers):this.set({polylineBarriers:n}),Z(s,this.polygonBarriers)?re(s,this.polygonBarriers):this.set({polygonBarriers:s}),this.set({checksum:t}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a),null!=a.geometry&&(this.spatialReference=a.geometry.spatialReference)}_getNetworkFeatures(e,t,s,n){const a=H(e)?e.layers:e.featureCollection?.layers,l=a?.find((e=>e.layerDefinition.name===t));if(null==l)return new i;const{layerDefinition:u,popupInfo:p,featureSet:c}=l,m=u.drawingInfo.renderer,{features:y}=c,f=c.spatialReference??u.spatialReference??u.extent.spatialReference??P,d=m&&F(m),h=B.fromJSON(f),w=y.map((e=>{const i=r.fromJSON(e);null!=i.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(i.geometry.spatialReference=h);const n=s(i);return n.symbol??=d?.getSymbol(i)??this._getNetworkSymbol(t),n.popupTemplate??=p&&o.fromJSON(p),n}));return n&&w.some((({symbol:e})=>!e))&&n(w),new i(w)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await A(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||!e.length||!this.defaultSymbols.stops||e.every((({symbol:e})=>!!e)))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops,a=e.map((({sequence:e})=>e)).filter((e=>null!=e)),l=e.length===a.length;if(!this.routeInfo&&!l||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const u=Math.min(...a),p=Math.max(...a);for(const c of e)c.sequence!==u?c.sequence!==p?this.routeInfo&&"ok"!==c.status&&"not-located-on-closest"!==c.status?c.symbol=i:"waypoint"!==c.locationType?"break"!==c.locationType?c.symbol=o:c.symbol=n:c.symbol=s:c.symbol=r:c.symbol=t}_toRouteLayerSolution(e){const{checksum:t,routeResults:r}=e,o=r[0].stops?.map((e=>V.fromJSON(e.toJSON())));this._setStopSymbol(o);const i=new ye(o),s=new ce(e.polygonBarriers?.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),n=new me(e.polylineBarriers?.map((e=>{const t=E.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new pe(e.pointBarriers?.map((e=>{const t=J.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),l=r[0].route?.toJSON(),u=U.fromJSON(l);u.symbol=this.defaultSymbols.routeInfo;const p=new ue(r[0].directionPoints?.features.map((e=>{const t=G.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{checksum:t,directionLines:new le(r[0].directionLines?.features.map((e=>{const t=x.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:p,pointBarriers:a,polygonBarriers:s,polylineBarriers:n,routeInfo:u,stops:i}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",x.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",G.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s){if(!e?.length)return null;const n=this.spatialReference.toJSON(),{fullExtent:a,maxScale:l,minScale:u}=this;return{featureSet:{features:e.toArray().map((e=>ae(e))),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:null!=t?t.toJSON():X(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:l,minScale:u,name:i,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",J.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",M.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",E.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new i([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",U.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",V.fields,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}_populatePortalFields(e,t,r){const o=t.networkDataset?.networkAttributes,i=o?.filter((({usageType:e})=>"cost"===e))??[],a=r.travelMode??t.defaultTravelMode;if(null==a)return void n.getLogger(this).warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:l,distanceAttributeName:u}=a,p=i.find((({name:e})=>e===l)),c=i.find((({name:e})=>e===u)),m=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=p?.units,f=c?.units;if(!y||!f)throw new s("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const d=r.directionsLanguage??t.directionsLanguage,h=r.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(i.filter((({name:e})=>e===l||e===u||e===m||null!=e&&h.includes(e))).map((({name:e})=>e))),g=e=>{for(const t in e)w.has(t)||delete e[t]};for(const s of e.pointBarriers)null!=s.costs&&(s.addedCost=s.costs[m]??0,g(s.costs));for(const s of e.polygonBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));for(const s of e.polylineBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));const{routeInfo:S}=e,{findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I}=r;S.analysisSettings=new q({accumulateAttributes:h,directionsLanguage:d,findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I,travelMode:a}),S.totalDuration=se(S.totalCosts?.[l]??0,y),S.totalDistance=ne(S.totalCosts?.[u]??0,f),S.totalLateDuration=se(S.totalViolations?.[l]??0,y),S.totalWaitDuration=se(S.totalWait?.[l]??0,y),null!=S.totalCosts&&g(S.totalCosts),null!=S.totalViolations&&g(S.totalViolations),null!=S.totalWait&&g(S.totalWait);for(const s of e.stops)null!=s.serviceCosts&&(s.serviceDuration=se(s.serviceCosts[l]??0,y),s.serviceDistance=ne(s.serviceCosts[u]??0,f),g(s.serviceCosts)),null!=s.cumulativeCosts&&(s.cumulativeDuration=se(s.cumulativeCosts[l]??0,y),s.cumulativeDistance=ne(s.cumulativeCosts[u]??0,f),g(s.cumulativeCosts)),null!=s.violations&&(s.lateDuration=se(s.violations[l]??0,y),g(s.violations)),null!=s.wait&&(s.waitDuration=se(s.wait[l]??0,y),g(s.wait))}};e([y({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],fe.prototype,"_featureCollection",void 0),e([h(["web-map","portal-item"],"_featureCollection")],fe.prototype,"writeFeatureCollectionWebmap",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],fe.prototype,"_type",void 0),e([y({type:String})],fe.prototype,"checksum",void 0),e([y({nonNullable:!0,type:L})],fe.prototype,"defaultSymbols",void 0),e([y({readOnly:!0})],fe.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],fe.prototype,"readDirectionLines",null),e([y({readOnly:!0})],fe.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],fe.prototype,"readDirectionPoints",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],fe.prototype,"featureCollectionType",void 0),e([y({readOnly:!0})],fe.prototype,"fullExtent",null),e([y({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],fe.prototype,"legendEnabled",void 0),e([y({type:["show","hide"]})],fe.prototype,"listMode",void 0),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],fe.prototype,"readMaxScale",null),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],fe.prototype,"readMinScale",null),e([y({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],fe.prototype,"operationalLayerType",void 0),e([y({nonNullable:!0,type:i.ofType(J)})],fe.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPointBarriers",null),e([y({nonNullable:!0,type:i.ofType(M)})],fe.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolygonBarriers",null),e([y({nonNullable:!0,type:i.ofType(E)})],fe.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolylineBarriers",null),e([y({readOnly:!0})],fe.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],fe.prototype,"readRouteInfo",null),e([y({type:B})],fe.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],fe.prototype,"readSpatialReference",null),e([y({nonNullable:!0,type:i.ofType(V)})],fe.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],fe.prototype,"readStops",null),e([y()],fe.prototype,"title",null),e([y({readOnly:!0,json:{read:!1}})],fe.prototype,"type",void 0),e([y()],fe.prototype,"url",null),fe=e([d("esri.layers.RouteLayer")],fe);const de=fe;export{de as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import r from"../Graphic.js";import o from"../PopupTemplate.js";import i from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as l}from"../core/object.js";import{isAbortError as u}from"../core/promiseUtils.js";import{on as p}from"../core/reactiveUtils.js";import{convertUnit as c}from"../core/unitUtils.js";import{urlToObject as m}from"../core/urlUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as f}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import{updateOrigins as w}from"../core/accessorSupport/originUtils.js";import g from"../geometry/Extent.js";import S from"../geometry/Multipoint.js";import{initializeProjection as b,project as v}from"../geometry/projectionUtils.js";import B from"../geometry/SpatialReference.js";import{wgs84 as P}from"../geometry/support/spatialReferenceUtils.js";import I from"./Layer.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{OperationalLayer as N}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{sanitizeUrl as _}from"./support/arcgisLayerUrl.js";import L from"./support/RouteSymbols.js";import O from"../portal/Portal.js";import R from"../portal/PortalItem.js";import{typeKeyword as T}from"../portal/support/portalItemUtils.js";import{read as F}from"../renderers/support/jsonUtils.js";import{fetchServiceDescription as A}from"../rest/networkService.js";import{solve as k}from"../rest/route.js";import x from"../rest/support/DirectionLine.js";import G from"../rest/support/DirectionPoint.js";import J from"../rest/support/PointBarrier.js";import M from"../rest/support/PolygonBarrier.js";import E from"../rest/support/PolylineBarrier.js";import U from"../rest/support/RouteInfo.js";import W from"../rest/support/RouteParameters.js";import q from"../rest/support/RouteSettings.js";import V from"../rest/support/Stop.js";function Y(e){if(!e.length)return;const t=e.toArray(),r=t.map((({objectId:e})=>e)).filter((e=>null!=e));let o=Math.max(...r,0);for(const i of t)null==i.objectId&&(i.objectId=++o)}function Z(e,t){return!!e.length&&e.length===t.length&&z(e)&&z(t)}function z(e){return e.every((({objectId:e})=>null!=e))}function K(e){return e.length?e:null}function X(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:X("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:X("esriGeometryPolyline")}}}function H(e){return"layers"in e}function Q(e){return"esri.rest.support.FeatureSet"===e.declaredClass}function $(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}function ee(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.addedCost=r.addedCost,e.barrierType=r.barrierType,e.costs=r.costs,e.curbApproach=r.curbApproach,e.fullEdge=r.fullEdge,e.geometry=r.geometry,e.name=r.name,e.sideOfEdge=r.sideOfEdge,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol)}}function te(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function re(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}function oe(e,t){for(const r of e){const e=t.find((e=>e.objectId===r.objectId));e&&(e.arriveCurbApproach=r.arriveCurbApproach,e.arriveTime=r.arriveTime,e.arriveTimeOffset=r.arriveTimeOffset,e.cumulativeCosts=r.cumulativeCosts,e.cumulativeDistance=r.cumulativeDistance,e.cumulativeDuration=r.cumulativeDuration,e.curbApproach=r.curbApproach,e.departCurbApproach=r.departCurbApproach,e.departTime=r.departTime,e.departTimeOffset=r.departTimeOffset,e.distanceToNetworkInMeters=r.distanceToNetworkInMeters,e.geometry=r.geometry,e.lateDuration=r.lateDuration,e.name=r.name,e.navLatency=r.navLatency,e.posAlong=r.posAlong,e.routeName=r.routeName,e.serviceCosts=r.serviceCosts,e.serviceDistance=r.serviceDistance,e.serviceDuration=r.serviceDuration,e.sequence=r.sequence,e.sideOfEdge=r.sideOfEdge,e.snapX=r.snapX,e.snapY=r.snapY,e.snapZ=r.snapZ,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol,e.timeWindowEnd=r.timeWindowEnd,e.timeWindowStart=r.timeWindowStart,e.violations=r.violations,e.waitDuration=r.waitDuration,e.wait=r.wait)}}async function ie(e){const t=B.WGS84;return await b(e.spatialReference,t),v(e,t)}function se(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ne(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:c(e,t,"meters")}function ae(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const le=i.ofType(x),ue=i.ofType(G),pe=i.ofType(J),ce=i.ofType(M),me=i.ofType(E),ye=i.ofType(V);let fe=class extends(j(C(N(D(a(I)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.checksum=null,this.defaultSymbols=new L,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new pe,this.polygonBarriers=new ce,this.polylineBarriers=new me,this.routeInfo=null,this.spatialReference=B.WGS84,this.stops=new ye,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(p((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n="web-map"===o.origin?"featureCollection.layers":"layers";l(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>x.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>G.fromGraphic(e)))}get fullExtent(){const e=new g({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:B.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter((e=>null!=e.geometry));if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new S({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.maxScale));return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=H(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.minScale));return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>J.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>M.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>E.fromGraphic(e)))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",(e=>U.fromGraphic(e))).at(0)??null}readSpatialReference(e,t){const r=H(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return B.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??P;return B.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>V.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set("url",_(e,n.getLogger(this))):this._set("url",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new s("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new s("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new s("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(!this.routeInfo)throw new s("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new s("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const n={messages:[],origin:"portal-item",portal:r,url:o?m(o):void 0,writtenProperties:[]},a=this.write(void 0,n);return t.extent=await ie(e),t.title=this.title,await t.update({data:a}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new s("routelayer:route-unsolved","saveAs() requires a solved route");const r=R.from(e).clone();r.extent??=await ie(this.fullExtent),r.id=null,r.portal??=O.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",T.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o.signIn();const n=t?.folder,a=this.write(void 0,i);return await o.user.addItem({item:r,folder:n,data:a}),this.portalItem=r,w(i),i.portalItem=r,r}async solve(e,t){Y(this.stops),Y(this.pointBarriers),Y(this.polylineBarriers),Y(this.polygonBarriers);const r=e?.stops??this.stops,o=e?.pointBarriers??K(this.pointBarriers),n=e?.polylineBarriers??K(this.polylineBarriers),a=e?.polygonBarriers??K(this.polygonBarriers);if(null==r)throw new s("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((Q(r)||$(r))&&r.features.length<2||i.isCollection(r)&&r.length<2)throw new s("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(i.isCollection(r))for(const i of r)i.routeName=null;const l=e?.apiKey,{checksum:p,url:c}=this,m=await this._getServiceDescription(c,l,t),y=e?.travelMode??m.defaultTravelMode,f=e?.accumulateAttributes??[];y&&(f.push(y.distanceAttributeName),y.timeAttributeName&&f.push(y.timeAttributeName));const d={accumulateAttributes:f,checksum:p,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:n,polygonBarriers:a,preserveObjectID:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!a,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:r},h=W.from(e??{});let w;h.set(d);try{w=await k(c,h,t)}catch(S){throw u(S)?S:new s("routelayer:failed-route-request","the routing request failed",{error:S})}const g=this._toRouteLayerSolution(w);return this._isOverridden("title")||(this.title=g.routeInfo.name??"Route"),this._populatePortalFields(g,m,h),g}update(e){const{checksum:t,directionLines:r,directionPoints:o,pointBarriers:i,polygonBarriers:s,polylineBarriers:n,routeInfo:a,stops:l}=e;Z(l,this.stops)?oe(l,this.stops):this.set({stops:l}),Z(i,this.pointBarriers)?ee(i,this.pointBarriers):this.set({pointBarriers:i}),Z(n,this.polylineBarriers)?te(n,this.polylineBarriers):this.set({polylineBarriers:n}),Z(s,this.polygonBarriers)?re(s,this.polygonBarriers):this.set({polygonBarriers:s}),this.set({checksum:t}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a),null!=a.geometry&&(this.spatialReference=a.geometry.spatialReference)}_getNetworkFeatures(e,t,s,n){const a=H(e)?e.layers:e.featureCollection?.layers,l=a?.find((e=>e.layerDefinition.name===t));if(null==l)return new i;const{layerDefinition:u,popupInfo:p,featureSet:c}=l,m=u.drawingInfo.renderer,{features:y}=c,f=c.spatialReference??u.spatialReference??u.extent.spatialReference??P,d=m&&F(m),h=B.fromJSON(f),w=y.map((e=>{const i=r.fromJSON(e);null!=i.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(i.geometry.spatialReference=h);const n=s(i);return n.symbol??=d?.getSymbol(i)??this._getNetworkSymbol(t),n.popupTemplate??=p&&o.fromJSON(p),n}));return n&&w.some((({symbol:e})=>!e))&&n(w),new i(w)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await A(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||!e.length||!this.defaultSymbols.stops||e.every((({symbol:e})=>!!e)))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops,a=e.map((({sequence:e})=>e)).filter((e=>null!=e)),l=e.length===a.length;if(!this.routeInfo&&!l||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const u=Math.min(...a),p=Math.max(...a);for(const c of e)c.sequence!==u?c.sequence!==p?this.routeInfo&&"ok"!==c.status&&"not-located-on-closest"!==c.status?c.symbol=i:"waypoint"!==c.locationType?"break"!==c.locationType?c.symbol=o:c.symbol=n:c.symbol=s:c.symbol=r:c.symbol=t}_toRouteLayerSolution(e){const{checksum:t,routeResults:r}=e,o=r[0].stops?.map((e=>V.fromJSON(e.toJSON())));this._setStopSymbol(o);const i=new ye(o),s=new ce(e.polygonBarriers?.map((e=>{const t=M.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),n=new me(e.polylineBarriers?.map((e=>{const t=E.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),a=new pe(e.pointBarriers?.map((e=>{const t=J.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),l=r[0].route?.toJSON(),u=U.fromJSON(l);u.symbol=this.defaultSymbols.routeInfo;const p=new ue(r[0].directionPoints?.features.map((e=>{const t=G.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{checksum:t,directionLines:new le(r[0].directionLines?.features.map((e=>{const t=x.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:p,pointBarriers:a,polygonBarriers:s,polylineBarriers:n,routeInfo:u,stops:i}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",x.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",G.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s){if(!e?.length)return null;const n=this.spatialReference.toJSON(),{fullExtent:a,maxScale:l,minScale:u}=this;return{featureSet:{features:e.toArray().map((e=>ae(e))),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:null!=t?t.toJSON():X(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:l,minScale:u,name:i,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",J.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",M.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",E.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new i([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",U.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",V.fields,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}_populatePortalFields(e,t,r){const o=t.networkDataset?.networkAttributes,i=o?.filter((({usageType:e})=>"cost"===e))??[],a=r.travelMode??t.defaultTravelMode;if(null==a)return void n.getLogger(this).warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:l,distanceAttributeName:u}=a,p=i.find((({name:e})=>e===l)),c=i.find((({name:e})=>e===u)),m=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=p?.units,f=c?.units;if(!y||!f)throw new s("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const d=r.directionsLanguage??t.directionsLanguage,h=r.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(i.filter((({name:e})=>e===l||e===u||e===m||null!=e&&h.includes(e))).map((({name:e})=>e))),g=e=>{for(const t in e)w.has(t)||delete e[t]};for(const s of e.pointBarriers)null!=s.costs&&(s.addedCost=s.costs[m]??0,g(s.costs));for(const s of e.polygonBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));for(const s of e.polylineBarriers)null!=s.costs&&(s.scaleFactor=s.costs[m]??1,g(s.costs));const{routeInfo:S}=e,{findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I}=r;S.analysisSettings=new q({accumulateAttributes:h,directionsLanguage:d,findBestSequence:b,preserveFirstStop:v,preserveLastStop:B,startTimeIsUTC:P,timeWindowsAreUTC:I,travelMode:a}),S.totalDuration=se(S.totalCosts?.[l]??0,y),S.totalDistance=ne(S.totalCosts?.[u]??0,f),S.totalLateDuration=se(S.totalViolations?.[l]??0,y),S.totalWaitDuration=se(S.totalWait?.[l]??0,y),null!=S.totalCosts&&g(S.totalCosts),null!=S.totalViolations&&g(S.totalViolations),null!=S.totalWait&&g(S.totalWait);for(const s of e.stops)null!=s.serviceCosts&&(s.serviceDuration=se(s.serviceCosts[l]??0,y),s.serviceDistance=ne(s.serviceCosts[u]??0,f),g(s.serviceCosts)),null!=s.cumulativeCosts&&(s.cumulativeDuration=se(s.cumulativeCosts[l]??0,y),s.cumulativeDistance=ne(s.cumulativeCosts[u]??0,f),g(s.cumulativeCosts)),null!=s.violations&&(s.lateDuration=se(s.violations[l]??0,y),g(s.violations)),null!=s.wait&&(s.waitDuration=se(s.wait[l]??0,y),g(s.wait))}};e([y({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],fe.prototype,"_featureCollection",void 0),e([h(["web-map","portal-item"],"_featureCollection")],fe.prototype,"writeFeatureCollectionWebmap",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],fe.prototype,"_type",void 0),e([y({type:String})],fe.prototype,"checksum",void 0),e([y({nonNullable:!0,type:L})],fe.prototype,"defaultSymbols",void 0),e([y({readOnly:!0})],fe.prototype,"directionLines",void 0),e([f(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],fe.prototype,"readDirectionLines",null),e([y({readOnly:!0})],fe.prototype,"directionPoints",void 0),e([f(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],fe.prototype,"readDirectionPoints",null),e([y({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],fe.prototype,"featureCollectionType",void 0),e([y({readOnly:!0})],fe.prototype,"fullExtent",null),e([y({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],fe.prototype,"legendEnabled",void 0),e([y({type:["show","hide"]})],fe.prototype,"listMode",void 0),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"maxScale",void 0),e([f(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],fe.prototype,"readMaxScale",null),e([y({type:Number,nonNullable:!0,json:{write:!1}})],fe.prototype,"minScale",void 0),e([f(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],fe.prototype,"readMinScale",null),e([y({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],fe.prototype,"operationalLayerType",void 0),e([y({nonNullable:!0,type:i.ofType(J)})],fe.prototype,"pointBarriers",void 0),e([f(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPointBarriers",null),e([y({nonNullable:!0,type:i.ofType(M)})],fe.prototype,"polygonBarriers",void 0),e([f(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolygonBarriers",null),e([y({nonNullable:!0,type:i.ofType(E)})],fe.prototype,"polylineBarriers",void 0),e([f(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],fe.prototype,"readPolylineBarriers",null),e([y({readOnly:!0})],fe.prototype,"routeInfo",void 0),e([f(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],fe.prototype,"readRouteInfo",null),e([y({type:B})],fe.prototype,"spatialReference",void 0),e([f(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],fe.prototype,"readSpatialReference",null),e([y({nonNullable:!0,type:i.ofType(V)})],fe.prototype,"stops",void 0),e([f(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],fe.prototype,"readStops",null),e([y()],fe.prototype,"title",null),e([y({readOnly:!0,json:{read:!1}})],fe.prototype,"type",void 0),e([y()],fe.prototype,"url",null),fe=e([d("esri.layers.RouteLayer")],fe);const de=fe;export{de as default};
|
package/layers/VideoLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p}from"../core/promiseUtils.js";import{watch as a,initial as y,whenOnce as m}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as d}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as h}from"../core/accessorSupport/PropertyOrigin.js";import f from"../geometry/Extent.js";import v from"../geometry/Polyline.js";import g from"../geometry/SpatialReference.js";import S from"./Layer.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as O,effectProperty as b}from"./mixins/BlendLayer.js";import{CustomParametersMixin as T}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{opacity as x,id as U}from"./support/commonProperties.js";import{normalizeParsedUrlObject as P,urlProperty as E}from"./support/multiLayerServiceUtils.js";import N from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as M}from"./support/serviceCapabilitiesUtils.js";import k from"./support/TelemetryData.js";import V from"./support/TelemetryDisplay.js";import F from"./support/VideoFrame.js";import R from"./support/VideoTimeExtent.js";import J from"./video/VideoController.js";import{getFrameHorizonPoints as G,getGroundControlPoints as H,getTelemetryData as z,getServiceLayersInfo as A,getSensorTrailPoints as q,readVideoTimeExtent as D}from"./video/videoUtils.js";import _ from"../symbols/CIMSymbol.js";import B from"../symbols/PictureMarkerSymbol.js";import W from"../symbols/SimpleFillSymbol.js";import Q from"../symbols/SimpleLineSymbol.js";import Z from"../symbols/SimpleMarkerSymbol.js";import K from"../symbols/Symbol.js";import{write as X}from"../symbols/support/jsonUtils.js";function Y(e,t){return{ignoreOrigin:this.originIdOf(t)<h.PORTAL_ITEM}}let $=[];const ee=new t([255,127,0]),te=new t([0,0,0,.05]),re=new Z({angle:0,color:ee,size:10,style:"cross"}),oe=new W({color:te,outline:new Q({color:ee,width:2})}),ie=new Q({color:ee,width:1}),se=new Z({angle:0,color:ee,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),le=new Q({color:ee,width:1}),ne={types:{base:K,key:"type",typeMap:{"simple-marker":Z,"picture-marker":B,cim:_}},json:{write:{writer:X,overridePolicy:Y}}};let pe=class extends(O(L(j(w(I(n(T(S)))))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new J,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=re.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=oe.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=se.clone(),this.sensorSightLineSymbol=ie.clone(),this.sensorTrailSymbol=le.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=g.WGS84,this.start=0,this.telemetryDisplay=new V,this.telemetryColor=ee,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),y)]),m((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!1},e).catch(p).then((()=>this._fetchService(t)));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return M(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return G(this.metadata)}get groundControlPoints(){return H(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return P(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return z(this.metadata)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return A(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=q(e,$);$=[...t];const r=$.map((e=>e.toArray())),o=new v({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],pe.prototype,"autoplay",null),e([u({readOnly:!0})],pe.prototype,"buffered",null),e([u({readOnly:!0,json:{read:!1}})],pe.prototype,"capabilities",void 0),e([d("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],pe.prototype,"readCapabilitiesFromService",null),e([u({readOnly:!0})],pe.prototype,"codecs",void 0),e([u({readOnly:!0})],pe.prototype,"connectionInfo",void 0),e([d("connectionInfo",["connectionUrl"])],pe.prototype,"readConnectionInfo",null),e([u()],pe.prototype,"controller",void 0),e([u({type:String})],pe.prototype,"copyright",void 0),e([u({readOnly:!0,type:Date})],pe.prototype,"created",void 0),e([u({type:Number})],pe.prototype,"currentTime",null),e([u({type:String})],pe.prototype,"description",void 0),e([u({type:Number})],pe.prototype,"duration",null),e([u({readOnly:!0})],pe.prototype,"elevationSource",void 0),e([u({type:Boolean})],pe.prototype,"ended",null),e([u({type:F})],pe.prototype,"frame",void 0),e([u()],pe.prototype,"frameCenterSymbol",void 0),e([u({readOnly:!0,type:Number})],pe.prototype,"frameCount",void 0),e([u(b)],pe.prototype,"frameEffect",void 0),e([u(x)],pe.prototype,"frameOpacity",void 0),e([u()],pe.prototype,"frameOutlineSymbol",void 0),e([u({type:f})],pe.prototype,"fullExtent",void 0),e([u({readOnly:!0})],pe.prototype,"frameHorizonPoints",null),e([u({readOnly:!0,json:{read:{reader:D,source:"time"}},type:R})],pe.prototype,"fullTimeExtent",void 0),e([u({readOnly:!0})],pe.prototype,"groundControlPoints",null),e([u(U)],pe.prototype,"id",void 0),e([u({type:f})],pe.prototype,"initialExtent",void 0),e([u({readOnly:!0})],pe.prototype,"isLive",null),e([u({type:Number,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],pe.prototype,"layerId",void 0),e([u({readOnly:!0})],pe.prototype,"livestreamStatus",null),e([u({type:Boolean})],pe.prototype,"loop",null),e([u({readOnly:!0})],pe.prototype,"metadata",null),e([u({readOnly:!0})],pe.prototype,"mimeType",null),e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],pe.prototype,"muted",null),e([u({type:["ArcGISVideoLayer"]})],pe.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],pe.prototype,"parsedUrl",null),e([u({type:N})],pe.prototype,"playbackInfo",void 0),e([u({type:Number})],pe.prototype,"playbackRate",null),e([u({readOnly:!0,type:String})],pe.prototype,"playerUrl",null),e([u({readOnly:!0})],pe.prototype,"playing",null),e([u({readOnly:!0,json:{read:{source:"poster"}}})],pe.prototype,"posterUrl",void 0),e([u({readOnly:!0})],pe.prototype,"qualities",void 0),e([u(ne)],pe.prototype,"sensorSymbol",void 0),e([u()],pe.prototype,"sensorSightLineSymbol",void 0),e([u()],pe.prototype,"sensorTrailSymbol",void 0),e([u({readOnly:!0})],pe.prototype,"serviceItemId",void 0),e([u()],pe.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],pe.prototype,"sourceQuality",void 0),e([u({readOnly:!0,json:{name:"serviceType"}})],pe.prototype,"sourceType",void 0),e([u()],pe.prototype,"spatialReference",void 0),e([u({json:{write:!0}})],pe.prototype,"start",void 0),e([u({readOnly:!0})],pe.prototype,"started",null),e([u({readOnly:!0,type:String})],pe.prototype,"state",null),e([u({readOnly:!0,type:k})],pe.prototype,"telemetry",null),e([u({type:V,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],pe.prototype,"telemetryDisplay",void 0),e([u({type:t,json:{write:{overridePolicy:Y}}})],pe.prototype,"telemetryColor",void 0),e([d("service","title",["name"])],pe.prototype,"readTitleFromService",null),e([u({readOnly:!0})],pe.prototype,"type",void 0),e([u(E())],pe.prototype,"url",void 0),e([u({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],pe.prototype,"version",void 0),e([u({readOnly:!0})],pe.prototype,"videoElement",null),e([u({readOnly:!0})],pe.prototype,"videoHeight",null),e([u({readOnly:!0,json:{read:!1}})],pe.prototype,"videoLayersInfo",void 0),e([d("service","videoLayersInfo",["id","name","poster","serviceType","type"])],pe.prototype,"readLayerInfosFromService",null),e([u({type:R,readOnly:!0})],pe.prototype,"videoTimeExtent",null),e([u({readOnly:!0})],pe.prototype,"videoWidth",null),e([u()],pe.prototype,"volume",null),e([u({readOnly:!0})],pe.prototype,"waiting",null),pe=e([c("esri.layers.VideoLayer")],pe);const ae=pe;export{ae as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p}from"../core/promiseUtils.js";import{watch as a,initial as y,whenOnce as u}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import{Integer as d}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as f}from"../core/accessorSupport/PropertyOrigin.js";import v from"../geometry/Extent.js";import g from"../geometry/Polyline.js";import S from"../geometry/SpatialReference.js";import j from"./Layer.js";import{ArcGISService as O}from"./mixins/ArcGISService.js";import{BlendLayer as b,effectProperty as T}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{titleFromUrlAndName as x}from"./support/arcgisLayerUrl.js";import{opacity as U,id as P}from"./support/commonProperties.js";import{normalizeParsedUrlObject as E,urlProperty as N}from"./support/multiLayerServiceUtils.js";import M from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as k}from"./support/serviceCapabilitiesUtils.js";import V from"./support/TelemetryData.js";import F from"./support/TelemetryDisplay.js";import R from"./support/VideoFrame.js";import G from"./support/VideoTimeExtent.js";import J from"./video/VideoController.js";import{getFrameHorizonPoints as A,getGroundControlPoints as H,getTelemetryData as z,getServiceLayersInfo as q,getSensorTrailPoints as D,readVideoTimeExtent as _}from"./video/videoUtils.js";import B from"../symbols/CIMSymbol.js";import W from"../symbols/PictureMarkerSymbol.js";import Q from"../symbols/SimpleFillSymbol.js";import $ from"../symbols/SimpleLineSymbol.js";import Z from"../symbols/SimpleMarkerSymbol.js";import K from"../symbols/Symbol.js";import{write as X}from"../symbols/support/jsonUtils.js";function Y(e,t){return{ignoreOrigin:this.originIdOf(t)<f.PORTAL_ITEM}}let ee=[];const te=new t([255,127,0]),re=new t([0,0,0,.05]),oe=new Z({angle:0,color:te,size:10,style:"cross"}),ie=new Q({color:re,outline:new $({color:te,width:2})}),se=new $({color:te,width:1}),le=new Z({angle:0,color:te,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),ne=new $({color:te,width:1}),pe={types:{base:K,key:"type",typeMap:{"simple-marker":Z,"picture-marker":W,cim:B}},json:{write:{writer:X,overridePolicy:Y}}};let ae=class extends(b(C(O(I(L(n(w(j)))))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new J,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=oe.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=ie.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=le.clone(),this.sensorSightLineSymbol=se.clone(),this.sensorTrailSymbol=ne.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=S.WGS84,this.start=0,this.telemetryDisplay=new F,this.telemetryColor=te,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),y)]),u((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!1},e).catch(p).then((()=>this._fetchService(t)));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return k(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return A(this.metadata)}get groundControlPoints(){return H(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return E(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return z(this.metadata)}readTitleFromService(e,{name:t}){return this.url?x(this.url,t):t}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return q(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}write(e,t){return null==this.layerId?(t?.messages?.push(new i("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' cannot be saved to a web map, web scene, or portal item. The ArcGIS server version must be greater than 11.2.`)),null):super.write(e,t)}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=D(e,ee);ee=[...t];const r=ee.map((e=>e.toArray())),o=new g({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([m({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ae.prototype,"autoplay",null),e([m({readOnly:!0})],ae.prototype,"buffered",null),e([m({readOnly:!0,json:{read:!1}})],ae.prototype,"capabilities",void 0),e([c("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],ae.prototype,"readCapabilitiesFromService",null),e([m({readOnly:!0})],ae.prototype,"codecs",void 0),e([m({readOnly:!0})],ae.prototype,"connectionInfo",void 0),e([c("connectionInfo",["connectionUrl"])],ae.prototype,"readConnectionInfo",null),e([m()],ae.prototype,"controller",void 0),e([m({type:String})],ae.prototype,"copyright",void 0),e([m({readOnly:!0,type:Date})],ae.prototype,"created",void 0),e([m({type:Number})],ae.prototype,"currentTime",null),e([m({type:String})],ae.prototype,"description",void 0),e([m({type:Number})],ae.prototype,"duration",null),e([m({readOnly:!0})],ae.prototype,"elevationSource",void 0),e([m({type:Boolean})],ae.prototype,"ended",null),e([m({type:R})],ae.prototype,"frame",void 0),e([m()],ae.prototype,"frameCenterSymbol",void 0),e([m({readOnly:!0,type:d})],ae.prototype,"frameCount",void 0),e([m(T)],ae.prototype,"frameEffect",void 0),e([m(U)],ae.prototype,"frameOpacity",void 0),e([m()],ae.prototype,"frameOutlineSymbol",void 0),e([m({type:v})],ae.prototype,"fullExtent",void 0),e([m({readOnly:!0})],ae.prototype,"frameHorizonPoints",null),e([m({readOnly:!0,json:{read:{reader:_,source:"time"}},type:G})],ae.prototype,"fullTimeExtent",void 0),e([m({readOnly:!0})],ae.prototype,"groundControlPoints",null),e([m(P)],ae.prototype,"id",void 0),e([m({type:v})],ae.prototype,"initialExtent",void 0),e([m({readOnly:!0})],ae.prototype,"isLive",null),e([m({type:d,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],ae.prototype,"layerId",void 0),e([m({readOnly:!0})],ae.prototype,"livestreamStatus",null),e([m({type:Boolean})],ae.prototype,"loop",null),e([m({readOnly:!0})],ae.prototype,"metadata",null),e([m({readOnly:!0})],ae.prototype,"mimeType",null),e([m({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ae.prototype,"muted",null),e([m({type:["ArcGISVideoLayer"]})],ae.prototype,"operationalLayerType",void 0),e([m({readOnly:!0})],ae.prototype,"parsedUrl",null),e([m({type:M})],ae.prototype,"playbackInfo",void 0),e([m({type:Number})],ae.prototype,"playbackRate",null),e([m({readOnly:!0,type:String})],ae.prototype,"playerUrl",null),e([m({readOnly:!0})],ae.prototype,"playing",null),e([m({readOnly:!0,json:{read:{source:"poster"}}})],ae.prototype,"posterUrl",void 0),e([m({readOnly:!0})],ae.prototype,"qualities",void 0),e([m(pe)],ae.prototype,"sensorSymbol",void 0),e([m()],ae.prototype,"sensorSightLineSymbol",void 0),e([m()],ae.prototype,"sensorTrailSymbol",void 0),e([m({readOnly:!0})],ae.prototype,"serviceItemId",void 0),e([m()],ae.prototype,"sourceJSON",void 0),e([m({readOnly:!0})],ae.prototype,"sourceQuality",void 0),e([m({readOnly:!0,json:{name:"serviceType"}})],ae.prototype,"sourceType",void 0),e([m()],ae.prototype,"spatialReference",void 0),e([m({json:{write:!0}})],ae.prototype,"start",void 0),e([m({readOnly:!0})],ae.prototype,"started",null),e([m({readOnly:!0,type:String})],ae.prototype,"state",null),e([m({readOnly:!0,type:V})],ae.prototype,"telemetry",null),e([m({type:F,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ae.prototype,"telemetryDisplay",void 0),e([m({type:t,json:{write:{overridePolicy:Y}}})],ae.prototype,"telemetryColor",void 0),e([c("service","title",["name"])],ae.prototype,"readTitleFromService",null),e([m({readOnly:!0})],ae.prototype,"type",void 0),e([m(N())],ae.prototype,"url",void 0),e([m({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],ae.prototype,"version",void 0),e([m({readOnly:!0})],ae.prototype,"videoElement",null),e([m({readOnly:!0})],ae.prototype,"videoHeight",null),e([m({readOnly:!0,json:{read:!1}})],ae.prototype,"videoLayersInfo",void 0),e([c("service","videoLayersInfo",["id","name","poster","serviceType","type"])],ae.prototype,"readLayerInfosFromService",null),e([m({type:G,readOnly:!0})],ae.prototype,"videoTimeExtent",null),e([m({readOnly:!0})],ae.prototype,"videoWidth",null),e([m()],ae.prototype,"volume",null),e([m({readOnly:!0})],ae.prototype,"waiting",null),ae=e([h("esri.layers.VideoLayer")],ae);const ye=ae;export{ye as default};
|
package/layers/WFSLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import r from"../PopupTemplate.js";import{MultiOriginJSONMixin as t}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as i}from"../core/object.js";import{urlToObject as o}from"../core/urlUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{Integer as n}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";import l from"../geometry/Extent.js";import m from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as d}from"../geometry/support/typeUtils.js";import u from"./Layer.js";import{WFSSource as y}from"./graphics/sources/WFSSource.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as c}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as h}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as j}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as w}from"./mixins/OrderedLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as b}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{TrackableLayer as O}from"./mixins/TrackableLayer.js";import{wfsOidFieldName as R}from"./ogc/wfsUtils.js";import{elevationInfo as S,labelsVisible as P,legendEnabled as T,opacityDrawingInfo as C,popupEnabled as E,screenSizePerspectiveEnabled as q,url as L}from"./support/commonProperties.js";import U from"./support/Field.js";import{defineFieldProperties as D}from"./support/fieldProperties.js";import{fixRendererFields as Q,fixTimeInfoFields as W}from"./support/fieldUtils.js";import N from"./support/LabelClass.js";import{reader as V}from"./support/labelingInfo.js";import{webSceneRendererTypes as X,rendererTypes as Y}from"../renderers/support/typeUtils.js";import k from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";import{timeZoneProperty as J}from"../time/timeZoneUtils.js";var M;const Z=D();let _=M=class extends(w(h(c(j(g(f(I(O(b(F(v(x(t(u)))))))))))))){static fromWFSLayerInfo(e){const{customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:m,wfsCapabilities:d}=e;return new M({customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:m,wfsCapabilities:d})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new y({layer:this}),this.spatialReference=m.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),Q(this.renderer,this.fieldsIndex),W(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t){const o=e.filter((e=>e.name!==R));this.geometryField&&o.unshift(new U({name:this.geometryField,alias:this.geometryField,type:"geometry"})),i(t,o.map((e=>e.toJSON())),r)}get parsedUrl(){return o(this.url)}set renderer(e){Q(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new k({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:r,timeExtent:t}=this;return e.timeExtent=null!=r&&null!=t?t.offset(-r.value,r.unit):t||null,e}getFieldDomain(e,r){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(k.from(e)||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this.load().then((()=>this.source.queryObjectIds(k.from(e)||this.createQuery(),r)))}queryFeatureCount(e,r){return this.load().then((()=>this.source.queryFeatureCount(k.from(e)||this.createQuery(),r)))}queryExtent(e,r){return this.load().then((()=>this.source.queryExtent(k.from(e)||this.createQuery(),r)))}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh();return null!=r&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([s({readOnly:!0})],_.prototype,"capabilities",null),e([s({type:String})],_.prototype,"copyright",void 0),e([s({readOnly:!0})],_.prototype,"createQueryVersion",null),e([s({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],_.prototype,"customParameters",void 0),e([s(J("dateFieldsTimeReference"))],_.prototype,"dateFieldsTimeZone",void 0),e([s({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([s({type:String})],_.prototype,"displayField",void 0),e([s(S)],_.prototype,"elevationInfo",void 0),e([s({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"featureUrl",void 0),e([s({type:[U],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([a("fields")],_.prototype,"writeFields",null),e([s(Z.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([s({type:l,json:{name:"extent"}})],_.prototype,"fullExtent",void 0),e([s()],_.prototype,"geometryField",void 0),e([s({type:String,json:{read:{source:"layerDefinition.geometryType",reader:d.read},write:{target:"layerDefinition.geometryType",writer:d.write,ignoreOrigin:!0},origins:{service:{read:d.read}}}})],_.prototype,"geometryType",void 0),e([s({type:String})],_.prototype,"id",void 0),e([s(P)],_.prototype,"labelsVisible",void 0),e([s({type:[N],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V},write:!0}})],_.prototype,"labelingInfo",void 0),e([s(T)],_.prototype,"legendEnabled",void 0),e([s({type:["show","hide"]})],_.prototype,"listMode",void 0),e([s({type:String})],_.prototype,"objectIdField",void 0),e([s({type:["WFS"]})],_.prototype,"operationalLayerType",void 0),e([s({type:n,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"maxRecordCount",void 0),e([s({type:n})],_.prototype,"maxPageCount",void 0),e([s({type:n})],_.prototype,"maxTotalRecordCount",void 0),e([s({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],_.prototype,"mode",void 0),e([s({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"name",void 0),e([s({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"namespaceUri",void 0),e([s(C)],_.prototype,"opacity",void 0),e([s(Z.outFields)],_.prototype,"outFields",void 0),e([s({readOnly:!0})],_.prototype,"parsedUrl",null),e([s(E)],_.prototype,"popupEnabled",void 0),e([s({type:r,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([s({types:Y,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:X,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],_.prototype,"renderer",null),e([s(q)],_.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],_.prototype,"source",void 0),e([s({type:m,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],_.prototype,"spatialReference",void 0),e([s({readOnly:!0,type:[n],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"spatialReferences",void 0),e([s({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"swapXY",void 0),e([s({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],_.prototype,"title",void 0),e([s({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([s(L)],_.prototype,"url",void 0),e([s({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"version",void 0),e([s()],_.prototype,"wfsCapabilities",null),_=M=e([p("esri.layers.WFSLayer")],_);const z=_;export{z as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import r from"../PopupTemplate.js";import t from"../core/Error.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as o}from"../core/object.js";import{urlToObject as s}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import{Integer as p}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import d from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as u}from"../geometry/support/typeUtils.js";import y from"./Layer.js";import{WFSSource as f}from"./graphics/sources/WFSSource.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as g}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as j}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as w}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as b}from"./mixins/OrderedLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as F}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as O}from"./mixins/TemporalLayer.js";import{TrackableLayer as S}from"./mixins/TrackableLayer.js";import{wfsOidFieldName as R}from"./ogc/wfsUtils.js";import{elevationInfo as P,labelsVisible as T,legendEnabled as q,opacityDrawingInfo as L,popupEnabled as E,screenSizePerspectiveEnabled as C,url as U}from"./support/commonProperties.js";import{validateBinsQuery as D}from"./support/featureLayerUtils.js";import Q from"./support/Field.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{fixRendererFields as B,fixTimeInfoFields as A}from"./support/fieldUtils.js";import N from"./support/LabelClass.js";import{reader as V}from"./support/labelingInfo.js";import{webSceneRendererTypes as X,rendererTypes as Y}from"../renderers/support/typeUtils.js";import k from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";import{timeZoneProperty as J}from"../time/timeZoneUtils.js";var M;const Z=W();let _=M=class extends(b(g(h(w(j(c(O(S(F(I(v(x(i(y)))))))))))))){static fromWFSLayerInfo(e){const{customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:m,wfsCapabilities:d}=e;return new M({customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:m,wfsCapabilities:d})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new f({layer:this}),this.spatialReference=d.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),B(this.renderer,this.fieldsIndex),A(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t){const i=e.filter((e=>e.name!==R));this.geometryField&&i.unshift(new Q({name:this.geometryField,alias:this.geometryField,type:"geometry"})),o(t,i.map((e=>e.toJSON())),r)}get parsedUrl(){return s(this.url)}set renderer(e){B(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new k({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:r,timeExtent:t}=this;return e.timeExtent=null!=r&&null!=t?t.offset(-r.value,r.unit):t||null,e}getFieldDomain(e,r){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(k.from(e)||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this.load().then((()=>this.source.queryObjectIds(k.from(e)||this.createQuery(),r)))}queryFeatureCount(e,r){return this.load().then((()=>this.source.queryFeatureCount(k.from(e)||this.createQuery(),r)))}queryExtent(e,r){return this.load().then((()=>this.source.queryExtent(k.from(e)||this.createQuery(),r)))}async queryAttributeBins(e,r){const{source:i,capabilities:o}=await this.load(),s="WFSLayer";if(!i.queryAttributeBins||!o?.operations?.supportsQueryBins)throw new t(s,"Layer source does not support queryAttributeBins capability");D(e,o,s);const n=await import("../rest/support/AttributeBinsQuery.js"),p=await i.queryAttributeBins(n.default.from(e),r);if(p.features)for(const t of p.features)t.layer=t.sourceLayer=this;return p}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh();return null!=r&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([n({readOnly:!0})],_.prototype,"capabilities",null),e([n({type:String})],_.prototype,"copyright",void 0),e([n({readOnly:!0})],_.prototype,"createQueryVersion",null),e([n({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],_.prototype,"customParameters",void 0),e([n(J("dateFieldsTimeReference"))],_.prototype,"dateFieldsTimeZone",void 0),e([n({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([n({type:String})],_.prototype,"displayField",void 0),e([n(P)],_.prototype,"elevationInfo",void 0),e([n({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"featureUrl",void 0),e([n({type:[Q],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([l("fields")],_.prototype,"writeFields",null),e([n(Z.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([n({type:m,json:{name:"extent"}})],_.prototype,"fullExtent",void 0),e([n()],_.prototype,"geometryField",void 0),e([n({type:String,json:{read:{source:"layerDefinition.geometryType",reader:u.read},write:{target:"layerDefinition.geometryType",writer:u.write,ignoreOrigin:!0},origins:{service:{read:u.read}}}})],_.prototype,"geometryType",void 0),e([n({type:String})],_.prototype,"id",void 0),e([n(T)],_.prototype,"labelsVisible",void 0),e([n({type:[N],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V},write:!0}})],_.prototype,"labelingInfo",void 0),e([n(q)],_.prototype,"legendEnabled",void 0),e([n({type:["show","hide"]})],_.prototype,"listMode",void 0),e([n({type:String})],_.prototype,"objectIdField",void 0),e([n({type:["WFS"]})],_.prototype,"operationalLayerType",void 0),e([n({type:p,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"maxRecordCount",void 0),e([n({type:p})],_.prototype,"maxPageCount",void 0),e([n({type:p})],_.prototype,"maxTotalRecordCount",void 0),e([n({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],_.prototype,"mode",void 0),e([n({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"name",void 0),e([n({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"namespaceUri",void 0),e([n(L)],_.prototype,"opacity",void 0),e([n(Z.outFields)],_.prototype,"outFields",void 0),e([n({readOnly:!0})],_.prototype,"parsedUrl",null),e([n(E)],_.prototype,"popupEnabled",void 0),e([n({type:r,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([n({types:Y,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:X,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],_.prototype,"renderer",null),e([n(C)],_.prototype,"screenSizePerspectiveEnabled",void 0),e([n({readOnly:!0})],_.prototype,"source",void 0),e([n({type:d,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],_.prototype,"spatialReference",void 0),e([n({readOnly:!0,type:[p],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"spatialReferences",void 0),e([n({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"swapXY",void 0),e([n({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],_.prototype,"title",void 0),e([n({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([n(U)],_.prototype,"url",void 0),e([n({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],_.prototype,"version",void 0),e([n()],_.prototype,"wfsCapabilities",null),_=M=e([a("esri.layers.WFSLayer")],_);const z=_;export{z as default};
|