@arcgis/core 4.34.0-next.14 → 4.34.0-next.15
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0512ee54f2259a437fdb.js +1 -0
- package/assets/esri/core/workers/chunks/{3145218abe59b5e99ff8.js → 05f2133f05f86266d8c7.js} +1 -1
- package/assets/esri/core/workers/chunks/0f81a2deb656e8b28eae.js +1 -0
- package/assets/esri/core/workers/chunks/{ad4f65d764654c70a117.js → 0f8f217aaf42eb1b9699.js} +1 -1
- package/assets/esri/core/workers/chunks/{74276044cb75b51967f2.js → 10eb89a93c8e31f03c95.js} +1 -1
- package/assets/esri/core/workers/chunks/15d3193576f93586674c.js +1 -0
- package/assets/esri/core/workers/chunks/{369978472cc9ee6a00b5.js → 1f559f1e7f0bc0f4bf20.js} +5 -5
- package/assets/esri/core/workers/chunks/243eb8a317333ec2715b.js +1 -0
- package/assets/esri/core/workers/chunks/273beed633cc37416ad7.js +1 -0
- package/assets/esri/core/workers/chunks/{63852887b3f07d50f7c9.js → 2ad538440cfb3ab94787.js} +1 -1
- package/assets/esri/core/workers/chunks/{aaa564c84ee8ea36fbb4.js → 49a57dc1e6d1048fa949.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7589c39b13295af8f1d.js → 604f8094992bb642378b.js} +1 -1
- package/assets/esri/core/workers/chunks/6975929fa91c81c8afc0.js +1 -0
- package/assets/esri/core/workers/chunks/{0eeb0dce918e4827309a.js → 70e5848aa372475fc8fa.js} +1 -1
- package/assets/esri/core/workers/chunks/7716a9fb380d66ba7292.js +1 -0
- package/assets/esri/core/workers/chunks/77ad62ed93f713a909f0.js +1 -0
- package/assets/esri/core/workers/chunks/7b9eec0090f48e9cdaf1.js +1 -0
- package/assets/esri/core/workers/chunks/{3b63edcd34f832ac7bd8.js → 7c6b9e2c1dada4668c01.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b21651eb93efe9ce089.js → 7f14d6cb754c7e94748c.js} +83 -83
- package/assets/esri/core/workers/chunks/{af0d7a7cbbaad47a49c6.js → 802c6b1a6cb9264b8e4f.js} +1 -1
- package/assets/esri/core/workers/chunks/8865bd8f196556441ce3.js +1 -0
- package/assets/esri/core/workers/chunks/8b1842f0f94c18652d4e.js +1 -0
- package/assets/esri/core/workers/chunks/932808e485f305b6a26a.js +1 -0
- package/assets/esri/core/workers/chunks/93c145a738b3f6cf4ee4.js +1 -0
- package/assets/esri/core/workers/chunks/9d779891d51d196aa8c8.js +1 -0
- package/assets/esri/core/workers/chunks/{6cbe8205a4e0f62da519.js → a5a27e2e9b91fbe12da9.js} +1 -1
- package/assets/esri/core/workers/chunks/aeac889d95f34b6d3b72.js +1 -0
- package/assets/esri/core/workers/chunks/d0876a713079c669995a.js +1 -0
- package/assets/esri/core/workers/chunks/{d5f770302dc686e55ba7.js → daffceecdc71e74d2629.js} +1 -1
- package/assets/esri/core/workers/chunks/e980a81c4d1e05f07141.js +1 -0
- package/assets/esri/core/workers/chunks/{998819aade3898f52414.js → ec49e2849766402ad5c7.js} +1 -1
- package/assets/esri/core/workers/chunks/fa3edfbdaa3b716a3a10.js +1 -0
- package/assets/esri/core/workers/chunks/fa5715ca3ce95d005b0a.js +1 -0
- package/assets/esri/themes/base/widgets/_SelectionList.scss +31 -28
- 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/chunks/chartUtilsAm5.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/utils.js +1 -1
- package/core/object.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
- package/interfaces.d.ts +25 -5
- package/intl/date.js +1 -1
- package/intl/duration.js +1 -1
- package/intl/locale.js +1 -1
- package/intl/messages.js +1 -1
- package/intl/number.js +1 -1
- package/intl.d.ts +1 -0
- package/intl.js +1 -1
- package/kernel.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/rasterDatasets/covJSONParser.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/package.json +1 -1
- package/renderers/support/DictionaryScriptEvaluator.js +1 -1
- package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
- package/rest/support/DateBinTimeInterval.js +1 -1
- package/rest/support/DateBinUtils.js +5 -0
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/ArcadeExpression.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +2 -2
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/ui/UI.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Directions/DirectionsVisibleElements.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflowData.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationNode.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider/scalePreviewUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/timeWidgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/18011c691e0aca4144dd.js +0 -1
- package/assets/esri/core/workers/chunks/183a7dec68c8ba6eb3d6.js +0 -1
- package/assets/esri/core/workers/chunks/2ddb776434a93b8d9e63.js +0 -1
- package/assets/esri/core/workers/chunks/3916879b9ca8c6979011.js +0 -1
- package/assets/esri/core/workers/chunks/3cbc498388fb1931a9f8.js +0 -1
- package/assets/esri/core/workers/chunks/4079e307a0fce4516aa4.js +0 -1
- package/assets/esri/core/workers/chunks/4088f4c25a09932a3eb1.js +0 -1
- package/assets/esri/core/workers/chunks/467cacb501b0417bb4df.js +0 -1
- package/assets/esri/core/workers/chunks/49089731ecfe7e8bb2f6.js +0 -1
- package/assets/esri/core/workers/chunks/4e0bae3671fe1c7efa76.js +0 -1
- package/assets/esri/core/workers/chunks/5df4f2315fae82030e87.js +0 -1
- package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +0 -1
- package/assets/esri/core/workers/chunks/a1a42b0d7cd47b647f8a.js +0 -1
- package/assets/esri/core/workers/chunks/a622ed3f182648ab3ff6.js +0 -1
- package/assets/esri/core/workers/chunks/a693cd3af2e995972252.js +0 -1
- package/assets/esri/core/workers/chunks/c8856370bae65d9eeb2b.js +0 -1
- package/assets/esri/core/workers/chunks/cd4fb107489594c57438.js +0 -1
- package/assets/esri/core/workers/chunks/d28d874c1337b69fedc0.js +0 -1
- package/assets/esri/core/workers/chunks/ec922f876e1465d36045.js +0 -1
package/config.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.
|
|
5
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.15";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{handlesGroup as r}from"../handleUtils.js";import{clone as t}from"../lang.js";function n(r){return r.__accessor__??null}function e(r,t){return null!=r?.metadata?.[t]}function i(r,t){const e=n(r);return e?e.getDependsInfo(r,t,""):""}function u(r,t,n){if(n){return a(r,t,{policy:n,path:""})}return a(r,t,null)}function a(r,n,e){return n?Object.keys(n).reduce(((r,i)=>{const u=i;let
|
|
5
|
+
import{handlesGroup as r}from"../handleUtils.js";import{clone as t}from"../lang.js";function n(r){return r.__accessor__??null}function e(r,t){return null!=r?.metadata?.[t]}function i(r,t){const e=n(r);return e?e.getDependsInfo(r,t,""):""}function u(r,t,n){if(n){return a(r,t,{policy:n,path:""})}return a(r,t,null)}function a(r,n,e){return n?Object.keys(n).reduce(((r,i)=>{const u=i;if("__proto__"===u)return r;let o=null,s="merge";if(e&&(o=e.path?`${e.path}.${i}`:i,s=e.policy(o)),"replace"===s)return r[u]=n[u],r;if("replace-arrays"===s&&Array.isArray(r[u]))return r[u]=n[u],r;if(void 0===r[u])return r[u]=t(n[u]),r;let c=r[u],l=n[u];if(c===l)return r;if(Array.isArray(l)||Array.isArray(r))c=c?Array.isArray(c)?r[u]=c.slice():r[u]=[c]:r[u]=[],l&&(Array.isArray(l)||(l=[l]),l.forEach((r=>{c.includes(r)||c.push(r)})));else if(l&&"object"==typeof l)if(e){const t=e.path;e.path=o,r[u]=a(c,l,e),e.path=t}else r[u]=a(c,l,null);else r.hasOwnProperty(i)&&!n.hasOwnProperty(i)||(r[u]=l);return r}),r||{}):r}function o(r){return Array.isArray(r)?r:r.split(".")}function s(r){return r.includes(",")?r.split(",").map((r=>r.trim())):[r.trim()]}function c(r){if(Array.isArray(r)){const t=[];for(const n of r)t.push(...s(n));return t}return s(r)}function l(t,n,e,i){const u=c(n);if(1!==u.length){const n=u.map((r=>i(t,r,e)));return r(n)}return i(t,u[0],e)}export{i as getDependsInfo,n as getProperties,e as isPropertyDeclared,u as merge,l as parse,o as pathToArray,c as splitPath};
|
package/core/object.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as r}from"./lang.js";function n(r,n,t=!1){return f(r,n,t)}function t(r,n){if(null!=n)return n[r]||u(r.split("."),!1,n)}function e(r,n,t){const e=r.split("."),i=e.pop(),f=u(e,!0,t);f&&i&&(f[i]=n)}function i(r,n){if(null==r&&null==n)return!1;if(null==r)return!0;if(null==n)return!0;if("object"==typeof r){if(Array.isArray(r)){const t=n;if(r.length!==t.length)return!0;for(let n=0;n<r.length;n++)if(i(r[n],t[n]))return!0;return!1}if(Object.keys(r).length!==Object.keys(n).length)return!0;for(const t in r){if(i(r[t],n[t]))return!0}return!1}return r!==n}function u(r,n,t){let e=t;for(const i of r){if(null==e)return;if(!(i in e)){if(!n)return;e[i]={}}e=e[i]}return e}function f(n,t,e){return t?Object.keys(t).reduce(((n,i)=>{let u=n[i],
|
|
5
|
+
import{clone as r}from"./lang.js";function n(r,n,t=!1){return f(r,n,t)}function t(r,n){if(null!=n)return n[r]||u(r.split("."),!1,n)}function e(r,n,t){const e=r.split("."),i=e.pop(),f=u(e,!0,t);f&&i&&(f[i]=n)}function i(r,n){if(null==r&&null==n)return!1;if(null==r)return!0;if(null==n)return!0;if("object"==typeof r){if(Array.isArray(r)){const t=n;if(r.length!==t.length)return!0;for(let n=0;n<r.length;n++)if(i(r[n],t[n]))return!0;return!1}if(Object.keys(r).length!==Object.keys(n).length)return!0;for(const t in r){if(i(r[t],n[t]))return!0}return!1}return r!==n}function u(r,n,t){let e=t;for(const i of r){if(null==e)return;if(!(i in e)){if(!n)return;e[i]={}}e=e[i]}return e}function f(n,t,e){return t?Object.keys(t).reduce(((n,i)=>{if("__proto__"===i)return n;let u=n[i],o=t[i];return u===o?n:void 0===u?(n[i]=r(o),n):(Array.isArray(o)||Array.isArray(n)?(u=u?Array.isArray(u)?n[i]=u.slice():n[i]=[u]:n[i]=[],o&&(Array.isArray(o)||(o=[o]),e?o.forEach((r=>{u.includes(r)||u.push(r)})):n[i]=o.slice())):o&&"object"==typeof o?n[i]=f(u,o,e):n.hasOwnProperty(i)&&!t.hasOwnProperty(i)||(n[i]=o),n)}),n||{}):n}export{n as deepMerge,t as getDeepValue,i as notDeepEqual,e as setDeepValue};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{correctZandMFollowingBuffer as t,makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{isPolygon as r}from"../support/executorUtils.js";import{e as s}from"../../../../chunks/bufferOperator.js";function o({templatePart:o,shape:i,edits:p,relationships:a,mode:
|
|
5
|
+
import{correctZandMFollowingBuffer as t,makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{isPolygon as r}from"../support/executorUtils.js";import{e as s}from"../../../../chunks/bufferOperator.js";function o({templatePart:o,shape:i,edits:p,relationships:a,mode:m}){if(!r(i))return;const n=o.builderConfig?.distanceValue??0,u=t(s(i,n),i);u&&e({templatePart:o,shape:u,edits:p,relationships:a,mode:m})}const i=!1;export{o as execute,i as isAsync};
|
package/interfaces.d.ts
CHANGED
|
@@ -14556,6 +14556,12 @@ declare namespace __esri {
|
|
|
14556
14556
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#getLocale Read more...}
|
|
14557
14557
|
*/
|
|
14558
14558
|
getLocale(): string;
|
|
14559
|
+
/**
|
|
14560
|
+
* This function returns the language code associated with the current locale.
|
|
14561
|
+
*
|
|
14562
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#getLocaleLanguage Read more...}
|
|
14563
|
+
*/
|
|
14564
|
+
getLocaleLanguage(): string | nullish;
|
|
14559
14565
|
/**
|
|
14560
14566
|
* Returns one of the known message bundle locale for an input locale.
|
|
14561
14567
|
*
|
|
@@ -14590,7 +14596,7 @@ declare namespace __esri {
|
|
|
14590
14596
|
*/
|
|
14591
14597
|
registerMessageBundleLoader(loader: MessageBundleLoader): any;
|
|
14592
14598
|
/**
|
|
14593
|
-
* Sets the locale used by the
|
|
14599
|
+
* Sets the locale used by the SDK.
|
|
14594
14600
|
*
|
|
14595
14601
|
* @param locale The new Unicode locale identifier string, similar to the Intl APIs. If this is `undefined`, the locale is reset to its default value described in {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#getLocale `getLocale()`}.
|
|
14596
14602
|
*
|
|
@@ -104701,6 +104707,13 @@ declare namespace __esri {
|
|
|
104701
104707
|
*/
|
|
104702
104708
|
get elements(): SlideElements | nullish;
|
|
104703
104709
|
set elements(value: SlideElementsProperties | nullish);
|
|
104710
|
+
/**
|
|
104711
|
+
* The enabled focus areas of the scene.
|
|
104712
|
+
*
|
|
104713
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#enabledFocusAreas Read more...}
|
|
104714
|
+
*/
|
|
104715
|
+
get enabledFocusAreas(): Collection<string> | nullish;
|
|
104716
|
+
set enabledFocusAreas(value: CollectionProperties<string> | nullish);
|
|
104704
104717
|
/**
|
|
104705
104718
|
* Represents settings that affect the environment in which the WebScene is displayed (such as lighting).
|
|
104706
104719
|
*
|
|
@@ -104806,6 +104819,12 @@ declare namespace __esri {
|
|
|
104806
104819
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#elements Read more...}
|
|
104807
104820
|
*/
|
|
104808
104821
|
elements?: SlideElementsProperties | nullish;
|
|
104822
|
+
/**
|
|
104823
|
+
* The enabled focus areas of the scene.
|
|
104824
|
+
*
|
|
104825
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#enabledFocusAreas Read more...}
|
|
104826
|
+
*/
|
|
104827
|
+
enabledFocusAreas?: CollectionProperties<string> | nullish;
|
|
104809
104828
|
/**
|
|
104810
104829
|
* Represents settings that affect the environment in which the WebScene is displayed (such as lighting).
|
|
104811
104830
|
*
|
|
@@ -110840,6 +110859,7 @@ declare namespace __esri {
|
|
|
110840
110859
|
export interface DirectionsVisibleElements {
|
|
110841
110860
|
editRouteButton?: boolean;
|
|
110842
110861
|
layerDetails?: boolean;
|
|
110862
|
+
printButton?: boolean;
|
|
110843
110863
|
saveAsButton?: boolean;
|
|
110844
110864
|
saveButton?: boolean;
|
|
110845
110865
|
}
|
|
@@ -125461,7 +125481,7 @@ declare namespace __esri {
|
|
|
125461
125481
|
*/
|
|
125462
125482
|
readonly id: string;
|
|
125463
125483
|
/**
|
|
125464
|
-
* The text that appears inside the
|
|
125484
|
+
* The text that appears inside the `Select template` button.
|
|
125465
125485
|
*
|
|
125466
125486
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-CustomTemplate.html#label Read more...}
|
|
125467
125487
|
*/
|
|
@@ -125524,8 +125544,8 @@ declare namespace __esri {
|
|
|
125524
125544
|
*/
|
|
125525
125545
|
readonly type: "browse-template" | "default-template" | "print-service-template" | nullish;
|
|
125526
125546
|
/**
|
|
125527
|
-
* Defines the custom layout template options used by the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html Print}
|
|
125528
|
-
* to generate the print page.
|
|
125547
|
+
* Defines the custom layout template options used by the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html Print widget} and
|
|
125548
|
+
* {@link https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-print/ Print component} to generate the print page.
|
|
125529
125549
|
*
|
|
125530
125550
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-CustomTemplate.html Read more...}
|
|
125531
125551
|
*/
|
|
@@ -126072,7 +126092,7 @@ declare namespace __esri {
|
|
|
126072
126092
|
*/
|
|
126073
126093
|
width: number | nullish;
|
|
126074
126094
|
/**
|
|
126075
|
-
* Defines the layout template options used by the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html Print
|
|
126095
|
+
* Defines the layout template options used by the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html Print widget} and {@link https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-print/ Print component} to generate printed output.
|
|
126076
126096
|
*
|
|
126077
126097
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html Read more...}
|
|
126078
126098
|
*/
|
package/intl/date.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{strict as t}from"../core/jsonMap.js";import{beforeLocaleChange as e,
|
|
5
|
+
import{strict as t}from"../core/jsonMap.js";import{beforeLocaleChange as e,getLocaleLanguage as o,normalizeLocale as n}from"./locale.js";import{unknown as r,utc as a,system as m,systemTimeZone as h}from"../time/constants.js";import{shortTimeZoneName as i}from"../time/timeZoneUtils.js";import{DateTime as s}from"luxon";const l={year:void 0,month:void 0,day:void 0,weekday:void 0},y={hour:void 0,minute:void 0,second:void 0},d={timeZone:a},g={year:"numeric",month:"numeric",day:"numeric"},u={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},D={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},T={...f,second:"numeric"},L={hourCycle:"h23"},S={...f,...L},M={...T,...L},w={"short-date":g,"short-date-short-time":{...g,...f},"short-date-short-time-24":{...g,...S},"short-date-long-time":{...g,...T},"short-date-long-time-24":{...g,...M},"short-date-le":g,"short-date-le-short-time":{...g,...f},"short-date-le-short-time-24":{...g,...S},"short-date-le-long-time":{...g,...T},"short-date-le-long-time-24":{...g,...M},"long-month-day-year":u,"long-month-day-year-short-time":{...u,...f},"long-month-day-year-short-time-24":{...u,...S},"long-month-day-year-long-time":{...u,...T},"long-month-day-year-long-time-24":{...u,...M},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...S},"day-short-month-year-long-time":{...c,...T},"day-short-month-year-long-time-24":{...c,...M},"long-date":D,"long-date-short-time":{...D,...f},"long-date-short-time-24":{...D,...S},"long-date-long-time":{...D,...T},"long-date-long-time-24":{...D,...M},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":T},Y=t()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),Z={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"},p=new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)),v=p.find((({type:t})=>"month"===t))?.value.toLowerCase();function j(){const t=o();return(t&&Z[t])??n()}"mart"!==v&&(Z.bs="sr-Latn-CS");let E=new WeakMap;const k=w["short-date-short-time"];function I(t){let e=E.get(t);if(!e){const o=j(),n=P(t.timeZone??m),r={...t,timeZone:n};e=new Intl.DateTimeFormat(o,r),E.set(t,e)}return e}function N(t){return w[t]}function C(t,e=k){return I(e).format(t)}function F(t,e=k){return C(new Date(t),{...e,...d,...y})}function b(t,e=k){return C(new Date(`1970-01-01T${t}Z`),{...e,...d,...l})}function x(t,e=k){if(e.timeZone)return C(new Date(t),e);const o=s.fromISO(t,{setZone:!0}),n=0===o.offset?a:e.timeZone,r={...e,timeZone:n};return o.toLocaleString(r,{locale:j()})}function P(t){switch(t){case m:return h;case r:return a;default:return t}}function W(t,e){return new Intl.DateTimeFormat(j(),e).formatToParts(t)}function O(t,e=new Date){return W(e,{timeZone:t,timeZoneName:i}).find((({type:t})=>"timeZoneName"===t))?.value}e((()=>{E=new WeakMap}));export{N as convertDateFormatToIntlOptions,Y as dateFormatJSONMap,C as formatDate,F as formatDateOnly,b as formatTimeOnly,x as formatTimestamp,I as getDateTimeFormatter,O as getShortOffsetTimeZoneSuffix,P as resolveTimeZone};
|
package/intl/duration.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{convertTime as o}from"../core/timeUtils.js";import{getLocale as
|
|
5
|
+
import{convertTime as o}from"../core/timeUtils.js";import{getLocale as t,getLocaleLanguage as l}from"./locale.js";import{Duration as n}from"luxon";function r(t,l="milliseconds",r={}){const i={locale:e(),numberingSystem:"latn"};let s;return s=t?n.fromMillis(o(t,l,"milliseconds"),i).rescale():n.fromObject({seconds:0},i),s.toHuman({listStyle:"narrow",unitDisplay:"long",...r})}function e(){const o=t();return"bs"===l(o)?"hr":o}export{r as formatDuration};
|
package/intl/locale.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{makeHandle as
|
|
5
|
+
import{makeHandle as n}from"../core/handleUtils.js";import"../core/has.js";let e,t;const o=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale,a=globalThis.document?.documentElement;function r(){const n=a?.getAttribute("lang"),e=globalThis.navigator?.language;return o??n??e??"en"}function l(){return void 0===t&&(t=r()),t}function i(n){e=n||void 0,x()}const c=/^(?<language>[a-z]{2,3})(?:-(?<extlang>[a-z]{3}))?(?:-[A-Z][a-z]{3})?(?:-(?<region>[A-Z]{2}|\d{3}))?(?:-.*)?$/;function s(n=l()){return g(n)?.language}function u(n=l()){const e=g(n);return e?.language&&e?.extlang?n.replace(`${e.language}-`,""):n}function g(n=l()){return c.exec(n)?.groups}function f(n=l()){const e=g(n)?.language;return"he"===e||"ar"===e}const h=[],d=new Map;function p(){const n=Array.from(d.values())[0];d.clear();const e=h.length;if(0!==e)throw new Error(`Unexpected ${e} locale change listeners still active.${n?` For example:\n${n}`:" Set enableListenerTracing in esri/intl/locale.ts to include a stack trace."}`)}function b(e){return h.push(e),n((()=>{h.splice(h.indexOf(e),1)}))}const m=[];function v(e){return m.push(e),n((()=>m.splice(m.indexOf(e),1)))}function x(){const n=e??r();t!==n&&([...m].forEach((e=>e(n))),t=n,[...h].forEach((e=>e(n))))}if(globalThis.addEventListener?.("languagechange",x),a){new MutationObserver((()=>{x()})).observe(a,{attributeFilter:["lang"]})}export{p as assertNoLocaleChangeListeners,v as beforeLocaleChange,r as getDefaultLocale,l as getLocale,s as getLocaleLanguage,g as getLocaleParts,u as normalizeLocale,b as onLocaleChange,f as prefersRTL,i as setLocale};
|
package/intl/messages.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../core/Error.js";import{makeHandle as n}from"../core/handleUtils.js";import{createResolver as e}from"../core/promiseUtils.js";import{getLocale as r,beforeLocaleChange as s,
|
|
5
|
+
import t from"../core/Error.js";import{makeHandle as n}from"../core/handleUtils.js";import{createResolver as e}from"../core/promiseUtils.js";import{getLocale as r,beforeLocaleChange as s,getLocaleLanguage as o}from"./locale.js";const i={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:"no",nl:!0,no:!0,nn:"no",pl:!0,pt:"pt-BR","pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,zh:"zh-CN","zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function a(t){return t in i}function c(t){if(a(t)){const n=i[t];return!0===n?t:n}return null}const d=[],l=new Map;function h(t){for(const n of l.keys())_(t.pattern,n)&&l.delete(n)}function u(t){return d.includes(t)||(h(t),d.unshift(t)),n((()=>{const n=d.indexOf(t);n>-1&&(d.splice(n,1),h(t))}))}async function f(t){const n=r();l.has(t)||l.set(t,p(t,n));const e=l.get(t);return e&&await g.add(e),e}function m(t){const n=o(t);return n?c(t)??c(n):null}async function p(n,e){const r=[];for(const t of d)if(_(t.pattern,n))try{return await t.fetchMessageBundle(n,e)}catch(s){r.push(s)}if(r.length)throw new t("intl:message-bundle-error",`Errors occurred while loading "${n}"`,{errors:r});throw new t("intl:no-message-bundle-loader",`No loader found for message bundle "${n}"`)}function _(t,n){return"string"==typeof t?n.startsWith(t):t.test(n)}s((()=>{l.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(t){return this._increase(),t.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=e())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}},w={cache:l,loaders:d};export{f as fetchMessageBundle,i as messageBundlesLocaleMap,m as normalizeMessageBundleLocale,u as registerMessageBundleLoader,w as test};
|
package/intl/number.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{getLocaleLanguage as e,normalizeLocale as n,beforeLocaleChange as t,getLocale as r}from"./locale.js";const u={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};let a=new WeakMap,i={};function l(t){const r=t||i;if(!a.has(r)){const i=e(),l=i&&u[i]||n();a.set(r,new Intl.NumberFormat(l,t))}return a.get(r)}function o(e={}){const n={};return null!=e.digitSeparator&&(n.useGrouping=e.digitSeparator),null!=e.places&&(n.minimumFractionDigits=n.maximumFractionDigits=e.places),n}function p(e,n){return Object.is(e,-0)&&(e=0),l(n).format(e)}function c(e,n=r()){if(!e)return null;let t=s.get(n);if(!t){const e=l().formatToParts(12345.6),r=[...l({useGrouping:!1}).format(9876543210)].reverse(),u=new Map(r.map(((e,n)=>[e,n]))),a=new RegExp(`[${e.find((e=>"group"===e.type))?.value}]`,"g"),i=new RegExp(`[${e.find((e=>"decimal"===e.type))?.value}]`),o=new RegExp(`[${r.join("")}]`,"g"),p=/[\u200E\u200F\u202A\u202B\u202C\u202D\u202E\u2066\u2067\u2068\u2069\u061C]/g,c=/[-\u2212\u2013\u2014\u2015]/g;t=e=>{if(""===(e=e.trim().replaceAll(a,"").replace(i,".").replace(o,(e=>String(u.get(e)))).replaceAll(p,"").replaceAll(c,"-")))return null;const n=Number(e);return isNaN(n)?null:n},s.set(n,t)}return t(e)}t((()=>{a=new WeakMap,i={}}));const s=new Map;export{o as convertNumberFormatToIntlOptions,p as formatNumber,l as getFormatter,c as parseNumber};
|
package/intl.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export const formatNumber: __esri.intl["formatNumber"];
|
|
|
10
10
|
export const formatTimeOnly: __esri.intl["formatTimeOnly"];
|
|
11
11
|
export const formatTimestamp: __esri.intl["formatTimestamp"];
|
|
12
12
|
export const getLocale: __esri.intl["getLocale"];
|
|
13
|
+
export const getLocaleLanguage: __esri.intl["getLocaleLanguage"];
|
|
13
14
|
export const normalizeMessageBundleLocale: __esri.intl["normalizeMessageBundleLocale"];
|
|
14
15
|
export const onLocaleChange: __esri.intl["onLocaleChange"];
|
|
15
16
|
export const prefersRTL: __esri.intl["prefersRTL"];
|
package/intl.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{convertDateFormatToIntlOptions,formatDate,formatDateOnly,formatTimeOnly,formatTimestamp}from"./intl/date.js";export{convertNumberFormatToIntlOptions,formatNumber}from"./intl/number.js";export{substitute}from"./intl/substitute.js";export{getLocale,onLocaleChange,prefersRTL,setLocale}from"./intl/locale.js";import{registerMessageBundleLoader as t}from"./intl/messages.js";export{fetchMessageBundle,normalizeMessageBundleLocale}from"./intl/messages.js";import{createJSONLoader as e}from"./intl/t9n.js";import{getAssetUrl as o}from"./assets.js";t(e({pattern:"esri/",location:o}));export{e as createJSONLoader,t as registerMessageBundleLoader};
|
|
5
|
+
export{convertDateFormatToIntlOptions,formatDate,formatDateOnly,formatTimeOnly,formatTimestamp}from"./intl/date.js";export{convertNumberFormatToIntlOptions,formatNumber}from"./intl/number.js";export{substitute}from"./intl/substitute.js";export{getLocale,getLocaleLanguage,onLocaleChange,prefersRTL,setLocale}from"./intl/locale.js";import{registerMessageBundleLoader as t}from"./intl/messages.js";export{fetchMessageBundle,normalizeMessageBundleLocale}from"./intl/messages.js";import{createJSONLoader as e}from"./intl/t9n.js";import{getAssetUrl as o}from"./assets.js";t(e({pattern:"esri/",location:o}));export{e as createJSONLoader,t as registerMessageBundleLoader};
|
package/kernel.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.15",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
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.34/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 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 H(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);H(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(this.applyPreferredHost(r),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:K}}})],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:K}}})],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};
|
|
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 F}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 b}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 C,getFeatureType as q,hasDataChanged as G,validateBinsQuery as U}from"./support/featureLayerUtils.js";import A from"./support/FeatureType.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as B}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=Q();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 H(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);H(o)||(t[r]=o)}let W=class extends(w(v(L(j(x(E(O(b(g(S(I(s(F(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 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 q(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 G(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&&B(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:i}=await this.load();U(e,i,"CatalogLayer");const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const a of s.features)a.layer=a.sourceLayer=this.footprintLayer;return s}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(this.applyPreferredHost(r),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:K}}})],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:K}}})],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:[A]})],W.prototype,"types",void 0),W=e([d("esri.layers.CatalogLayer")],W);const z=W;export{z as default};
|
package/layers/FeatureLayer.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../request.js";import i from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c}from"../core/promiseUtils.js";import{sqlAnd as m}from"../core/sql.js";import{urlToObject as h,join as f}from"../core/urlUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as g}from"../core/accessorSupport/decorators/cast.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{writer as j}from"../core/accessorSupport/decorators/writer.js";import{excludeTables as T}from"../core/accessorSupport/layerContainerType.js";import F from"../form/FormTemplate.js";import S from"../geometry/SpatialReference.js";import I from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as D}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as x}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as C}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as P}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as q}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as O}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as Q}from"./mixins/PortalLayer.js";import{PublishableLayer as R}from"./mixins/PublishableLayer.js";import{RefreshableLayer as U}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{TrackableLayer as $}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as G,parse as J,cleanTitle as W}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as Z,id as H,labelsVisible as k,opacityDrawingInfo as z,legendEnabled as K,listMode as X,popupEnabled as Y,screenSizePerspectiveEnabled as ee}from"./support/commonProperties.js";import{ensureLayerCredential as te,computeEffectiveEditingEnabled as re,readGlobalIdField as ie,readObjectIdField as oe,createDefaultRenderer as se,addAttachment as ae,updateAttachment as ne,applyEdits as le,uploadAssets as pe,createQuery as ue,deleteAttachments as de,fetchRecomputedExtents as ye,getFeatureType as ce,getFieldDomain as me,queryAttachments as he,queryObjectIds as fe,queryFeatureCount as be,queryExtent as ge,queryRelatedFeatures as we,queryRelatedFeaturesCount as ve,validateBinsQuery as je,hasDataChanged as Te,geometryTypeKebabDict as Fe}from"./support/featureLayerUtils.js";import Se from"./support/FeatureTemplate.js";import Ie from"./support/FeatureType.js";import{defineFieldProperties as Ee}from"./support/fieldProperties.js";import{fixRendererFields as Le,fixTimeInfoFields as De}from"./support/fieldUtils.js";import _e from"./support/LabelClass.js";import{reader as xe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Ce}from"./support/serviceCapabilitiesUtils.js";import Pe from"./support/TimeInfo.js";import Me from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as qe}from"./support/versionUtils.js";import{DataLayerSource as Oe}from"./support/source/DataLayerSource.js";import{read as Ae}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ve}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Qe,rendererTypes as Re}from"../renderers/support/typeUtils.js";import Ue from"../rest/support/FeatureSet.js";import Be from"../rest/support/Query.js";import{isNumber as Ne}from"../support/guards.js";import{createPopupTemplate as $e}from"../support/popupUtils.js";import{symbolTypes as Ge}from"../symbols/support/typeUtils.js";import{SaveOperationType as Je}from"../webdoc/interfaces.js";import{opacityToTransparency as We}from"../webdoc/support/opacityUtils.js";const Ze="FeatureLayer";function He(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function ke(e){return e&&e instanceof o}const ze=Ee();function Ke(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Xe=class extends(q(O(M(R(P(C(_(V(N($(B(U(D(A(Q(p(x(L(i.ClonableMixin(I)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=S.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=d((async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case Je.SAVE:return i(this,t);case Je.SAVE_AS:return o(this,r,t)}}))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(y).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>te(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return l(e),new Me({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Ce(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return re(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&u(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ie(t.layerDefinition||t)}readObjectIdField(e,t){return oe(t.layerDefinition||t)}get parsedUrl(){const e=h(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=f(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=f(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Le(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ae(i,t,r)??void 0;return e||n.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return se(t,r)}set source(e){const t=this._get("source");t!==e&&(ke(t)&&this._resetMemorySource(t),ke(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof o?new E({layer:this,items:e}):e:null}readSource(e,t){const r=Ue.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map((e=>Se.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?G(this.url,r):r;let t=r;if(!t&&this.url){const e=J(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),W(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map((e=>(e=Ie.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await ae(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ne(this,e,t,r,Ze);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return le(this,e,t)}async uploadAssets(e,t){return pe(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return $e(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=ue(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=m(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await de(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ye(this,e,Ze)}getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){return this._titleCreator.getTitle(this,e,t)}getFeatureType(e){return ce(this.types,this.typeIdField,e)}getFieldDomain(e,t){return me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return he(this,e,t,Ze)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Be.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return await fe(this,e,t,Ze)}async queryFeatureCount(e,t){return be(this,e,t,Ze)}async queryExtent(e,t){return ge(this,e,t,Ze)}async queryRelatedFeatures(e,t){return we(this,e,t,Ze)}async queryRelatedFeaturesCount(e,t){return ve(this,e,t,Ze)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),a=await r.queryTopFeatures(o.default.from(e),t);if(a?.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins||!i?.operations?.supportsQueryBins)throw new s(Ze,"Layer source does not support queryAttributeBins capability");je(e,i,Ze);const o=await import("../rest/support/AttributeBinsQuery.js"),a=await r.queryAttributeBins(o.default.from(e),t);if(a.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ne)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(He(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return o?.push(He(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(He(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return o?.push(He(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(Ze,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||qe(this,e))}async save(e){return this._debouncedSaveOperations(Je.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Je.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";u("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return r(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Le(this.renderer,this.fieldsIndex),De(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ve(this,{origin:"service"})}async hasDataChanged(){return Te(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new s("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this.addHandles([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};e([b({clonable:!1,readOnly:!0})],Xe.prototype,"_titleCreator",null),e([b(Z)],Xe.prototype,"attributeTableTemplate",void 0),e([w("service","capabilities")],Xe.prototype,"readCapabilities",null),e([b({json:{origins:{"web-scene":{write:!1}},write:!0}})],Xe.prototype,"charts",void 0),e([b({readOnly:!0})],Xe.prototype,"createQueryVersion",null),e([b({json:{read:{source:"layerDefinition.copyrightText"}}})],Xe.prototype,"copyright",void 0),e([b({json:{read:{source:"layerDefinition.displayField"}}})],Xe.prototype,"displayField",void 0),e([b({types:Ge,readOnly:!0})],Xe.prototype,"defaultSymbol",void 0),e([b({type:Oe})],Xe.prototype,"dynamicDataSource",void 0),e([b({type:Boolean})],Xe.prototype,"editingEnabled",null),e([w(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabled",null),e([w("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabledFromWebMap",null),e([j(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabled",null),e([j("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabledToWebMap",null),e([b({readOnly:!0})],Xe.prototype,"effectiveEditingEnabled",null),e([b({clonable:!1,readOnly:!0})],Xe.prototype,"featureTitleFields",null),e([b({...ze.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ke}}}}})],Xe.prototype,"fields",void 0),e([b(ze.fieldsIndex)],Xe.prototype,"fieldsIndex",void 0),e([b({type:F,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Xe.prototype,"formTemplate",void 0),e([b({json:{read:{source:"layerDefinition.extent"}}})],Xe.prototype,"fullExtent",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ke,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Xe.prototype,"geometryType",void 0),e([b({json:{read:{source:"layerDefinition.hasM"}}})],Xe.prototype,"hasM",void 0),e([b({json:{read:{source:"layerDefinition.hasZ"}}})],Xe.prototype,"hasZ",void 0),e([b(H)],Xe.prototype,"id",void 0),e([b({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Xe.prototype,"infoFor3D",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Xe.prototype,"isTable",void 0),e([w("service","isTable",["type","geometryType"]),w("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Xe.prototype,"readIsTable",null),e([j("web-map","isTable")],Xe.prototype,"writeIsTable",null),e([b(k)],Xe.prototype,"labelsVisible",void 0),e([b({type:[_e],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:xe,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:xe,write:{layerContainerTypes:T}}})],Xe.prototype,"labelingInfo",void 0),e([b((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,We(e),t)}}},e})())],Xe.prototype,"opacity",void 0),e([b(K)],Xe.prototype,"legendEnabled",void 0),e([b({type:["show","hide"],json:(()=>{const e=a(X.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Xe.prototype,"listMode",void 0),e([w("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Xe.prototype,"readGlobalIdField",null),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ke}}}}})],Xe.prototype,"objectIdField",void 0),e([w("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Xe.prototype,"readObjectIdField",null),e([b({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:T}}})],Xe.prototype,"operationalLayerType",void 0),e([b(ze.outFields)],Xe.prototype,"outFields",void 0),e([b({readOnly:!0})],Xe.prototype,"parsedUrl",null),e([b({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Xe.prototype,"path",void 0),e([b(Y)],Xe.prototype,"popupEnabled",void 0),e([b({type:t,json:{name:"popupInfo",write:!0}})],Xe.prototype,"popupTemplate",void 0),e([b({readOnly:!0})],Xe.prototype,"defaultPopupTemplate",null),e([b({types:Re,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Qe,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:T,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}})],Xe.prototype,"renderer",null),e([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Xe.prototype,"readRenderer",null),e([b()],Xe.prototype,"resourceInfo",void 0),e([b((()=>{const e=a(ee);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([b({clonable:!1})],Xe.prototype,"source",null),e([g("source")],Xe.prototype,"castSource",null),e([w("portal-item","source",["featureSet"]),w("web-map","source",["featureSet"])],Xe.prototype,"readSource",null),e([b({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],Xe.prototype,"spatialReference",void 0),e([b({type:Number})],Xe.prototype,"subtypeCode",void 0),e([b({type:[Se]})],Xe.prototype,"templates",void 0),e([w("templates",["editFieldsInfo","creatorField","editorField","templates"])],Xe.prototype,"readTemplates",null),e([b({type:Pe})],Xe.prototype,"timeInfo",void 0),e([b()],Xe.prototype,"title",void 0),e([w("service","title",["name"]),w("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Xe.prototype,"readTitle",null),e([w("web-map","title",["layerDefinition.name","title"])],Xe.prototype,"readTitleFromWebMap",null),e([b({type:String})],Xe.prototype,"sublayerTitleMode",void 0),e([b({json:{read:!1}})],Xe.prototype,"type",void 0),e([b({type:String})],Xe.prototype,"typeIdField",void 0),e([w("service","typeIdField"),w("typeIdField",["layerDefinition.typeIdField"])],Xe.prototype,"readTypeIdField",null),e([b({type:[Ie]})],Xe.prototype,"types",void 0),e([w("service","types",["types"]),w("types",["layerDefinition.types"])],Xe.prototype,"readTypes",null),e([b({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:T}}}}})],Xe.prototype,"visible",void 0),e([w("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Xe.prototype,"readVisible",null),Xe=e([v("esri.layers.FeatureLayer")],Xe);export{Xe as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../request.js";import i from"../core/Clonable.js";import o from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as u}from"../core/object.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c}from"../core/promiseUtils.js";import{sqlAnd as m}from"../core/sql.js";import{urlToObject as h,join as f}from"../core/urlUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as g}from"../core/accessorSupport/decorators/cast.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{writer as j}from"../core/accessorSupport/decorators/writer.js";import{excludeTables as T}from"../core/accessorSupport/layerContainerType.js";import F from"../form/FormTemplate.js";import S from"../geometry/SpatialReference.js";import I from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as D}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as x}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as C}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as P}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as q}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as O}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{PublishableLayer as U}from"./mixins/PublishableLayer.js";import{RefreshableLayer as Q}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{TrackableLayer as $}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as G,parse as J,cleanTitle as W}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as Z,id as H,labelsVisible as k,opacityDrawingInfo as z,legendEnabled as K,listMode as X,popupEnabled as Y,screenSizePerspectiveEnabled as ee}from"./support/commonProperties.js";import{ensureLayerCredential as te,computeEffectiveEditingEnabled as re,readGlobalIdField as ie,readObjectIdField as oe,createDefaultRenderer as se,addAttachment as ae,updateAttachment as ne,applyEdits as le,uploadAssets as pe,createQuery as ue,deleteAttachments as de,fetchRecomputedExtents as ye,getFeatureType as ce,getFieldDomain as me,queryAttachments as he,queryObjectIds as fe,queryFeatureCount as be,queryExtent as ge,queryRelatedFeatures as we,queryRelatedFeaturesCount as ve,validateBinsQuery as je,hasDataChanged as Te,geometryTypeKebabDict as Fe}from"./support/featureLayerUtils.js";import Se from"./support/FeatureTemplate.js";import Ie from"./support/FeatureType.js";import{defineFieldProperties as Ee}from"./support/fieldProperties.js";import{fixRendererFields as Le,fixTimeInfoFields as De}from"./support/fieldUtils.js";import _e from"./support/LabelClass.js";import{reader as xe}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Ce}from"./support/serviceCapabilitiesUtils.js";import Pe from"./support/TimeInfo.js";import Me from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as qe}from"./support/versionUtils.js";import{DataLayerSource as Oe}from"./support/source/DataLayerSource.js";import{read as Ae}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ve}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Re,rendererTypes as Ue}from"../renderers/support/typeUtils.js";import Qe from"../rest/support/FeatureSet.js";import Be from"../rest/support/Query.js";import{isNumber as Ne}from"../support/guards.js";import{createPopupTemplate as $e}from"../support/popupUtils.js";import{symbolTypes as Ge}from"../symbols/support/typeUtils.js";import{SaveOperationType as Je}from"../webdoc/interfaces.js";import{opacityToTransparency as We}from"../webdoc/support/opacityUtils.js";const Ze="FeatureLayer";function He(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function ke(e){return e&&e instanceof o}const ze=Ee();function Ke(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let Xe=class extends(q(O(M(U(P(C(_(V(N($(B(Q(D(A(R(p(x(L(i.ClonableMixin(I)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=S.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=d((async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case Je.SAVE:return i(this,t);case Je.SAVE_AS:return o(this,r,t)}}))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(y).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new s("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>te(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return l(e),new Me({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Ce(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return re(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&u(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ie(t.layerDefinition||t)}readObjectIdField(e,t){return oe(t.layerDefinition||t)}get parsedUrl(){const e=h(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=f(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=f(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Le(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ae(i,t,r)??void 0;return e||n.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return se(t,r)}set source(e){const t=this._get("source");t!==e&&(ke(t)&&this._resetMemorySource(t),ke(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof o?new E({layer:this,items:e}):e:null}readSource(e,t){const r=Qe.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map((e=>Se.fromJSON(e))),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?G(this.url,r):r;let t=r;if(!t&&this.url){const e=J(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),W(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map((e=>(e=Ie.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e)))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await ae(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await ne(this,e,t,r,Ze);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return le(this,e,t)}async uploadAssets(e,t){return pe(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return $e(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=ue(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=m(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await de(this,e,t,Ze);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ye(this,e,Ze)}getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){return this._titleCreator.getTitle(this,e,t)}getFeatureType(e){return ce(this.types,this.typeIdField,e)}getFieldDomain(e,t){return me(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return he(this,e,t,Ze)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(Be.from(e)??r.createQuery(),t);if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return await fe(this,e,t,Ze)}async queryFeatureCount(e,t){return be(this,e,t,Ze)}async queryExtent(e,t){return ge(this,e,t,Ze)}async queryRelatedFeatures(e,t){return we(this,e,t,Ze)}async queryRelatedFeaturesCount(e,t){return ve(this,e,t,Ze)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),a=await r.queryTopFeatures(o.default.from(e),t);if(a?.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new s(Ze,"Layer source does not support queryAttributeBins capability");je(e,i,Ze);const o=await import("../rest/support/AttributeBinsQuery.js"),a=await r.queryAttributeBins(o.default.from(e),t);if(a.features)for(const s of a.features)s.layer=s.sourceLayer=this;return a}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ne)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new s(Ze,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o?.push(He(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return o?.push(He(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return o?.push(He(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return o?.push(He(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new s(Ze,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||qe(this,e))}async save(e){return this._debouncedSaveOperations(Je.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Je.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";u("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return r(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Le(this.renderer,this.fieldsIndex),De(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ve(this,{origin:"service"})}async hasDataChanged(){return Te(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new s("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new s("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this.addHandles([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};e([b({clonable:!1,readOnly:!0})],Xe.prototype,"_titleCreator",null),e([b(Z)],Xe.prototype,"attributeTableTemplate",void 0),e([w("service","capabilities")],Xe.prototype,"readCapabilities",null),e([b({json:{origins:{"web-scene":{write:!1}},write:!0}})],Xe.prototype,"charts",void 0),e([b({readOnly:!0})],Xe.prototype,"createQueryVersion",null),e([b({json:{read:{source:"layerDefinition.copyrightText"}}})],Xe.prototype,"copyright",void 0),e([b({json:{read:{source:"layerDefinition.displayField"}}})],Xe.prototype,"displayField",void 0),e([b({types:Ge,readOnly:!0})],Xe.prototype,"defaultSymbol",void 0),e([b({type:Oe})],Xe.prototype,"dynamicDataSource",void 0),e([b({type:Boolean})],Xe.prototype,"editingEnabled",null),e([w(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabled",null),e([w("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Xe.prototype,"readEditingEnabledFromWebMap",null),e([j(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabled",null),e([j("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Xe.prototype,"writeEditingEnabledToWebMap",null),e([b({readOnly:!0})],Xe.prototype,"effectiveEditingEnabled",null),e([b({clonable:!1,readOnly:!0})],Xe.prototype,"featureTitleFields",null),e([b({...ze.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Ke}}}}})],Xe.prototype,"fields",void 0),e([b(ze.fieldsIndex)],Xe.prototype,"fieldsIndex",void 0),e([b({type:F,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Xe.prototype,"formTemplate",void 0),e([b({json:{read:{source:"layerDefinition.extent"}}})],Xe.prototype,"fullExtent",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Ke,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&u(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Xe.prototype,"geometryType",void 0),e([b({json:{read:{source:"layerDefinition.hasM"}}})],Xe.prototype,"hasM",void 0),e([b({json:{read:{source:"layerDefinition.hasZ"}}})],Xe.prototype,"hasZ",void 0),e([b(H)],Xe.prototype,"id",void 0),e([b({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Xe.prototype,"infoFor3D",void 0),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Xe.prototype,"isTable",void 0),e([w("service","isTable",["type","geometryType"]),w("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Xe.prototype,"readIsTable",null),e([j("web-map","isTable")],Xe.prototype,"writeIsTable",null),e([b(k)],Xe.prototype,"labelsVisible",void 0),e([b({type:[_e],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:xe,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:xe,write:{layerContainerTypes:T}}})],Xe.prototype,"labelingInfo",void 0),e([b((()=>{const e=a(z);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){u(r,We(e),t)}}},e})())],Xe.prototype,"opacity",void 0),e([b(K)],Xe.prototype,"legendEnabled",void 0),e([b({type:["show","hide"],json:(()=>{const e=a(X.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Xe.prototype,"listMode",void 0),e([w("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Xe.prototype,"readGlobalIdField",null),e([b({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Ke}}}}})],Xe.prototype,"objectIdField",void 0),e([w("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Xe.prototype,"readObjectIdField",null),e([b({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:T}}})],Xe.prototype,"operationalLayerType",void 0),e([b(ze.outFields)],Xe.prototype,"outFields",void 0),e([b({readOnly:!0})],Xe.prototype,"parsedUrl",null),e([b({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Xe.prototype,"path",void 0),e([b(Y)],Xe.prototype,"popupEnabled",void 0),e([b({type:t,json:{name:"popupInfo",write:!0}})],Xe.prototype,"popupTemplate",void 0),e([b({readOnly:!0})],Xe.prototype,"defaultPopupTemplate",null),e([b({types:Ue,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Re,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:T,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}})],Xe.prototype,"renderer",null),e([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Xe.prototype,"readRenderer",null),e([b()],Xe.prototype,"resourceInfo",void 0),e([b((()=>{const e=a(ee);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([b({clonable:!1})],Xe.prototype,"source",null),e([g("source")],Xe.prototype,"castSource",null),e([w("portal-item","source",["featureSet"]),w("web-map","source",["featureSet"])],Xe.prototype,"readSource",null),e([b({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],Xe.prototype,"spatialReference",void 0),e([b({type:Number})],Xe.prototype,"subtypeCode",void 0),e([b({type:[Se]})],Xe.prototype,"templates",void 0),e([w("templates",["editFieldsInfo","creatorField","editorField","templates"])],Xe.prototype,"readTemplates",null),e([b({type:Pe})],Xe.prototype,"timeInfo",void 0),e([b()],Xe.prototype,"title",void 0),e([w("service","title",["name"]),w("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Xe.prototype,"readTitle",null),e([w("web-map","title",["layerDefinition.name","title"])],Xe.prototype,"readTitleFromWebMap",null),e([b({type:String})],Xe.prototype,"sublayerTitleMode",void 0),e([b({json:{read:!1}})],Xe.prototype,"type",void 0),e([b({type:String})],Xe.prototype,"typeIdField",void 0),e([w("service","typeIdField"),w("typeIdField",["layerDefinition.typeIdField"])],Xe.prototype,"readTypeIdField",null),e([b({type:[Ie]})],Xe.prototype,"types",void 0),e([w("service","types",["types"]),w("types",["layerDefinition.types"])],Xe.prototype,"readTypes",null),e([b({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:T}}}}})],Xe.prototype,"visible",void 0),e([w("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Xe.prototype,"readVisible",null),Xe=e([v("esri.layers.FeatureLayer")],Xe);export{Xe 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as i}from"../core/promiseUtils.js";import{urlToObject as o}from"../core/urlUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/Extent.js";import a from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as l}from"../geometry/support/typeUtils.js";import u from"./Layer.js";import{GeoJSONSource as d}from"./graphics/sources/GeoJSONSource.js";import{BlendLayer as m}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as c}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as h}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as f}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as g}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 F}from"./mixins/TrackableLayer.js";import{attributeTableTemplate as O,elevationInfo as T,id as E,labelsVisible as S,legendEnabled as w,opacity as L,popupEnabled as P,screenSizePerspectiveEnabled as q,url as U}from"./support/commonProperties.js";import{validateBinsQuery as D}from"./support/featureLayerUtils.js";import J from"./support/FeatureTemplate.js";import N from"./support/Field.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{fixRendererFields as G,fixTimeInfoFields as Q}from"./support/fieldUtils.js";import B from"./support/LabelClass.js";import{reader as C}from"./support/labelingInfo.js";import{webSceneRendererTypes as Z,rendererTypes as V}from"../renderers/support/typeUtils.js";import _ from"../rest/support/Query.js";import{createPopupTemplate as A}from"../support/popupUtils.js";import{timeZoneProperty as M}from"../time/timeZoneUtils.js";const k=R();let z=class extends(g(c(y(f(h(m(I(F(x(b(j(v(r(u)))))))))))))){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 d({layer:this}),this.spatialReference=a.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"),G(this.renderer,this.fieldsIndex),Q(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?o(this.url):null}set renderer(e){G(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=o(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 i=await r(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),i}on(e,t){return super.on(e,t)}createPopupTemplate(e){return A(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:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||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:r,capabilities:i}=await this.load();D(e,i,"GeoJSONLayer");const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const p of s.features)p.layer=p.sourceLayer=this;return s}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([s(O)],z.prototype,"attributeTableTemplate",void 0),e([s({readOnly:!0,json:{read:!1,write:!1}})],z.prototype,"capabilities",null),e([s({type:String})],z.prototype,"copyright",void 0),e([s({readOnly:!0})],z.prototype,"createQueryVersion",null),e([s(M("dateFieldsTimeReference"))],z.prototype,"dateFieldsTimeZone",void 0),e([s({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],z.prototype,"definitionExpression",void 0),e([s({type:String})],z.prototype,"displayField",void 0),e([s({type:Boolean})],z.prototype,"editingEnabled",void 0),e([s(T)],z.prototype,"elevationInfo",void 0),e([s({type:[N],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],z.prototype,"fields",void 0),e([s(k.fieldsIndex)],z.prototype,"fieldsIndex",void 0),e([s({type:n,json:{name:"extent"}})],z.prototype,"fullExtent",void 0),e([s({type:["point","polygon","polyline","multipoint"],json:{read:{reader:l.read}}})],z.prototype,"geometryType",void 0),e([s({type:Boolean})],z.prototype,"hasZ",void 0),e([s(E)],z.prototype,"id",void 0),e([s({type:Boolean,readOnly:!0})],z.prototype,"isTable",null),e([s(S)],z.prototype,"labelsVisible",void 0),e([s({type:[B],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:C},write:!0}})],z.prototype,"labelingInfo",void 0),e([s(w)],z.prototype,"legendEnabled",void 0),e([s({type:["show","hide"]})],z.prototype,"listMode",void 0),e([s({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],z.prototype,"objectIdField",void 0),e([s(L)],z.prototype,"opacity",void 0),e([s({type:["GeoJSON"]})],z.prototype,"operationalLayerType",void 0),e([s(k.outFields)],z.prototype,"outFields",void 0),e([s({readOnly:!0})],z.prototype,"parsedUrl",null),e([s(P)],z.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:!0}})],z.prototype,"popupTemplate",void 0),e([s({types:V,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Z}}}})],z.prototype,"renderer",null),e([s(q)],z.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],z.prototype,"source",void 0),e([s({type:a})],z.prototype,"spatialReference",void 0),e([s({type:[J]})],z.prototype,"templates",void 0),e([s()],z.prototype,"title",void 0),e([s({json:{read:!1},readOnly:!0})],z.prototype,"type",void 0),e([s(U)],z.prototype,"url",null),z=e([p("esri.layers.GeoJSONLayer")],z);const W=z;export{W 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
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};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import{MultiOriginJSONMixin as r}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 b}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}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 S}from"./ogc/wfsUtils.js";import{elevationInfo as R,labelsVisible as P,legendEnabled as T,opacityDrawingInfo as L,popupEnabled as q,screenSizePerspectiveEnabled as C,url as E}from"./support/commonProperties.js";import{validateBinsQuery as U}from"./support/featureLayerUtils.js";import D from"./support/Field.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{fixRendererFields as W,fixTimeInfoFields as B}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 A}from"../support/popupUtils.js";import{timeZoneProperty as G}from"../time/timeZoneUtils.js";var J;const M=Q();let Z=J=class extends(w(h(c(j(g(f(I(O(x(F(v(b(r(u)))))))))))))){static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:m,wfsCapabilities:d}=e;return new J({customParameters:t,fields:r,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"),W(this.renderer,this.fieldsIndex),B(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,t,r){const o=e.filter((e=>e.name!==S));this.geometryField&&o.unshift(new D({name:this.geometryField,alias:this.geometryField,type:"geometry"})),i(r,o.map((e=>e.toJSON())),t)}get parsedUrl(){return o(this.url)}set renderer(e){W(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 A(this,e)}createQuery(){const e=new k({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:t,timeExtent:r}=this;return e.timeExtent=null!=t&&null!=r?r.offset(-t.value,t.unit):r||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(k.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(k.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(k.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(k.from(e)||this.createQuery(),t)))}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();U(e,i,"WFSLayer");const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh();return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([s({readOnly:!0})],Z.prototype,"capabilities",null),e([s({type:String})],Z.prototype,"copyright",void 0),e([s({readOnly:!0})],Z.prototype,"createQueryVersion",null),e([s({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],Z.prototype,"customParameters",void 0),e([s(G("dateFieldsTimeReference"))],Z.prototype,"dateFieldsTimeZone",void 0),e([s({readOnly:!0})],Z.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Z.prototype,"definitionExpression",void 0),e([s({type:String})],Z.prototype,"displayField",void 0),e([s(R)],Z.prototype,"elevationInfo",void 0),e([s({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"featureUrl",void 0),e([s({type:[D],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],Z.prototype,"fields",void 0),e([a("fields")],Z.prototype,"writeFields",null),e([s(M.fieldsIndex)],Z.prototype,"fieldsIndex",void 0),e([s({type:l,json:{name:"extent"}})],Z.prototype,"fullExtent",void 0),e([s()],Z.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}}}})],Z.prototype,"geometryType",void 0),e([s({type:String})],Z.prototype,"id",void 0),e([s(P)],Z.prototype,"labelsVisible",void 0),e([s({type:[N],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V},write:!0}})],Z.prototype,"labelingInfo",void 0),e([s(T)],Z.prototype,"legendEnabled",void 0),e([s({type:["show","hide"]})],Z.prototype,"listMode",void 0),e([s({type:String})],Z.prototype,"objectIdField",void 0),e([s({type:["WFS"]})],Z.prototype,"operationalLayerType",void 0),e([s({type:n,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"maxRecordCount",void 0),e([s({type:n})],Z.prototype,"maxPageCount",void 0),e([s({type:n})],Z.prototype,"maxTotalRecordCount",void 0),e([s({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],Z.prototype,"mode",void 0),e([s({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"name",void 0),e([s({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"namespaceUri",void 0),e([s(L)],Z.prototype,"opacity",void 0),e([s(M.outFields)],Z.prototype,"outFields",void 0),e([s({readOnly:!0})],Z.prototype,"parsedUrl",null),e([s(q)],Z.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:!0}})],Z.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}}})],Z.prototype,"renderer",null),e([s(C)],Z.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],Z.prototype,"source",void 0),e([s({type:m,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],Z.prototype,"spatialReference",void 0),e([s({readOnly:!0,type:[n],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"spatialReferences",void 0),e([s({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"swapXY",void 0),e([s({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],Z.prototype,"title",void 0),e([s({json:{read:!1},readOnly:!0})],Z.prototype,"type",void 0),e([s(E)],Z.prototype,"url",void 0),e([s({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],Z.prototype,"version",void 0),e([s()],Z.prototype,"wfsCapabilities",null),Z=J=e([p("esri.layers.WFSLayer")],Z);const _=Z;export{_ as default};
|