@arcgis/core 5.1.0-next.67 → 5.1.0-next.69
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/{2e1aecdf59ad3421bbad.js → 0e2e4cb34ac6aac88ebf.js} +1 -1
- package/assets/esri/core/workers/chunks/{38816f95e801f1c5bbad.js → 1c742bfe3b0aa51823d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{27262083d37fe623ca9c.js → 210629f3c28d4339c655.js} +1 -1
- package/assets/esri/core/workers/chunks/27643750dce502fedef3.js +1 -0
- package/assets/esri/core/workers/chunks/29878b52aa12b3815230.js +1 -0
- package/assets/esri/core/workers/chunks/{7fb9a5bc22d7581f1d20.js → 29b1a4ce7646b403008e.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb7392799a01c2a8497a.js → 2da62687ff678b690839.js} +1 -1
- package/assets/esri/core/workers/chunks/2fd4220131bfc3f5e2dd.js +1 -0
- package/assets/esri/core/workers/chunks/{a118de5a163ae42bee60.js → 333a0038d782d8a34d58.js} +1 -1
- package/assets/esri/core/workers/chunks/38328a785365c4783b1e.js +1 -0
- package/assets/esri/core/workers/chunks/{e268e5be096392c2e69b.js → 3eef3c2e94aa2a00d76a.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5b395e518e4c5fc95d0.js → 40d6ad030614099155cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{427183ea93e759943a78.js → 43678e08a3d9d51c2a6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{af007ec833ab49e4c958.js → 453280ea87a696a4df81.js} +1 -1
- package/assets/esri/core/workers/chunks/{921c30b7f4dfc3e018d9.js → 4605a68e40c5c3ac6e3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{abd5c1d4b7b91d9ea1eb.js → 478879ba965798f61bf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa69cbaa38b49677ddff.js → 499b899bf88aaf29230d.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a0f254d45d00b293479.js → 49fb9c47070641bce9a9.js} +1 -1
- package/assets/esri/core/workers/chunks/{f8eb14170f927aecfbc8.js → 4f9d027055f3a616173c.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e7b084f7104deea1ddb.js → 53b797e384be9628fc94.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff0cb1eec14d34214f12.js → 5fe97253f80c797fad7f.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f8ed1e7c1b10cb30972.js → 678c9f15712cf3d3bb9e.js} +1 -1
- package/assets/esri/core/workers/chunks/{4005d37d03c834da7629.js → 68a313155ddc29bd024d.js} +1 -1
- package/assets/esri/core/workers/chunks/{684ea7f75a7a5fb52cde.js → 6a21c9a4aeebe806ea39.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f196ec93925dfefc69a.js → 6bb090f3e5c18604cb39.js} +1 -1
- package/assets/esri/core/workers/chunks/73e000cc3c4da10e9937.js +1 -0
- package/assets/esri/core/workers/chunks/{79df97e3f5975b42dc4d.js → 75669912cddcb5db52c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{749c368f5cc2366716f1.js → 7bd1d624f4f4a11a31e8.js} +1 -1
- package/assets/esri/core/workers/chunks/7cadfd7444a2a05cf2fb.js +1 -0
- package/assets/esri/core/workers/chunks/{1515824f11ef5ab95378.js → 7d0350f459844162d3a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d069a0ebadb9c53b550.js → 7e39e9d4d68843b60e4c.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d5bc17557a31ed79ed8.js → 81750c5177d8d52a3e05.js} +1 -1
- package/assets/esri/core/workers/chunks/{7d73472696ec76458758.js → 81b2985b83be8f8f1090.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8ef9ed9b59de95f2b23.js → 823127b23bec07e1f9d0.js} +2 -2
- package/assets/esri/core/workers/chunks/{b8bf3e8b8b870f69f231.js → 8969788c57bcc11bf77b.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e7bb224bde9e5039263.js → 8b8f391f27774aec6db9.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e90e9ea1ad587eb3495.js → 8ea4584e07ccc85caabd.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c40b3c2b9071edb758d.js → 8fb336c2066113300d0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b5648a0b92cf1a2c81ad.js → 915a5e8aecf25f3bc72b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ffcd308087c35adda04.js → 9bd713d96502ddc2ce25.js} +1 -1
- package/assets/esri/core/workers/chunks/{9622a83b29acb768fcb5.js → a25acccda8febac71a3d.js} +1 -1
- package/assets/esri/core/workers/chunks/a30815a0155a3b8790b4.js +1 -0
- package/assets/esri/core/workers/chunks/{90cef6f96df7dc27db39.js → a43decc8ede8b4910553.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd26e3a29161ea411e41.js → a94bd20551c1179c7ec5.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa7ae035472540999721.js → b2120c4c56656be941ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{a59db907ec1e31002100.js → b85c9ceeece1bae67a16.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4e936879c6cb25cf586.js → b8a11d32a4847513619b.js} +1 -1
- package/assets/esri/core/workers/chunks/bbaf1d9835671c0165ca.js +1 -0
- package/assets/esri/core/workers/chunks/{cb9185ed31109781fe59.js → bc887bd62579dba81e2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e9b790fe01b89acdf6d.js → bcefdf9753d9d2f6f1be.js} +1 -1
- package/assets/esri/core/workers/chunks/{927773ed23b1fc245bf7.js → be61ea8e1883b915bbb1.js} +1 -1
- package/assets/esri/core/workers/chunks/c02ba921c0a32d2021e3.js +1 -0
- package/assets/esri/core/workers/chunks/{9a95c28d4a3b3b4b2c50.js → c49c078be08c38a6088d.js} +1 -1
- package/assets/esri/core/workers/chunks/{d94dfb2ce31e59b3306b.js → c79827f879d1d58d3f1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{56036327e721f9c42b33.js → c7ca47f5d4b2f3885239.js} +1 -1
- package/assets/esri/core/workers/chunks/{d83ac66478a419e08af6.js → d3d9d40556c847bba1a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{789357e0f79823f145dd.js → d4e55eb75fa4d3ac1e84.js} +1 -1
- package/assets/esri/core/workers/chunks/{fee31d9297648219375d.js → d8d7331600d93bbca2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e907acaec4c62adac2f2.js → e0fe23019410dea8236b.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f847a426973bd350c11.js → e5801b0f3893d4d4f5b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ab8ed12d162d79a8c55.js → e62d08f5488a74cbda82.js} +1 -1
- package/assets/esri/core/workers/chunks/{b4fb4484fa39eede1f62.js → e66b9d00d02fc08cbb2d.js} +1 -1
- package/assets/esri/core/workers/chunks/{69520cad347947b09f21.js → ecb7ede6a8e6c05e4c6c.js} +1 -1
- package/assets/esri/core/workers/chunks/ef9d74f8d5a502fda809.js +1 -0
- package/assets/esri/core/workers/chunks/f0bc5e8e44d53b73d431.js +1 -0
- package/assets/esri/core/workers/chunks/f11ea0d3de93ec0392af.js +1 -0
- package/assets/esri/core/workers/chunks/{cc8e6d1eb90221103023.js → f1e5626a0cc1631a1efb.js} +1 -1
- package/assets/esri/core/workers/chunks/{afea4a4b072c329d3749.js → fc64ae69581e4c38fa8a.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f8e8f83ebda07d29ca8.js → fd6bbe47773bbd9f7dd9.js} +1 -1
- package/assets/esri/core/workers/chunks/{8418ad9ad7b6481ebe82.js → ffb70e9358c0b171a315.js} +1 -1
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/config.js +1 -1
- package/core/string.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/kernel.js +1 -1
- package/layers/GroupLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/{lazyLayerLoader.js → layersLoader.js} +1 -1
- package/layers/support/layersMapping.js +2 -0
- package/package.json +2 -2
- package/popup/Feature.d.ts +3 -3
- package/popup/Features.d.ts +1 -13
- package/popup/Features.js +1 -1
- package/popup/actionUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rest/knowledgeGraph/GraphQueryResultHeader.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/SelectionManager.d.ts +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/DrawManipulator.js +1 -1
- package/views/draw/DrawManipulator3D.js +2 -0
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/Compass/CompassViewModel.d.ts +1 -0
- package/widgets/Compass/CompassViewModel.js +1 -1
- package/widgets/Compass.js +1 -1
- package/assets/esri/core/workers/chunks/12294f8c32c34788b6de.js +0 -1
- package/assets/esri/core/workers/chunks/151c2766a4cacc6adbd6.js +0 -1
- package/assets/esri/core/workers/chunks/1984c0f037065acd21d3.js +0 -1
- package/assets/esri/core/workers/chunks/4fd1bf82939e3bb9bc03.js +0 -1
- package/assets/esri/core/workers/chunks/61794a861a9209b72622.js +0 -1
- package/assets/esri/core/workers/chunks/644dd906bee3ef465ec0.js +0 -1
- package/assets/esri/core/workers/chunks/6f079f1fd6d00d2d174c.js +0 -1
- package/assets/esri/core/workers/chunks/751f3cfb000045ac78bb.js +0 -1
- package/assets/esri/core/workers/chunks/a80eb704e75d13732878.js +0 -1
- package/assets/esri/core/workers/chunks/c72e90a952543d06d84b.js +0 -1
- package/assets/esri/core/workers/chunks/e9f2b573f482718306e6.js +0 -1
- package/assets/esri/core/workers/chunks/f62e42659b406435573d.js +0 -1
- package/layers/mixins/operationalLayerModuleMap.js +0 -2
- package/layers/mixins/operationalLayers.js +0 -2
- /package/assets/esri/core/workers/chunks/{a8ef9ed9b59de95f2b23.js.LICENSE.txt → 823127b23bec07e1f9d0.js.LICENSE.txt} +0 -0
package/popup/Features.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{isSome as i}from"../core/arrayUtils.js";import s from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import o from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as a,isAbortError as l}from"../core/promiseUtils.js";import u from"../core/ReactiveSet.js";import{watch as h,when as c,sync as p}from"../core/reactiveUtils.js";import{addMany as d}from"../core/SetUtils.js";import{property as g,subclass as m}from"../core/accessorSupport/decorators.js";import f from"../geometry/Point.js";import{initializeProjection as y,project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as w}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as C}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as b,zoomToClusteredFeatures as I,browseClusteredFeatures as P,zoomToFeature as A}from"./actions.js";import{isClusterFeature as L,updateClusterFeaturesForPopupFeatures as j,displayClusterExtent as x,getSelectedTarget as E}from"./actionUtils.js";import R from"./Feature.js";import O from"./support/FeatureAbilities.js";import B from"../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as U}from"../symbols/support/symbolUtils.js";import{system as S}from"../time/constants.js";import{highlightsSupported as T}from"../views/support/layerViewUtils.js";import{GoTo as M}from"../widgets/support/GoTo.js";const H="location-scale-handle",G=()=>[A.clone()],V=()=>[I.clone(),P.clone()];let D=null;function Z(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let z=class extends(M(r)){constructor(e){super(e),this._pendingPromises=new u,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._clusterBrowsingController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this.actions=new b,this.activeFeature=null,this.browseClusterEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.selectedClusterBoundaryFeature=new t({symbol:new B({outline:{width:1.5,color:"cyan"},style:"none"})}),this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),c(()=>!this.waitingForResult,()=>this._waitingForResultChange(),p),h(()=>this.view?.scale,()=>this._viewScaleChange()),c(()=>!this.open,()=>this.browseClusterEnabled=!1),h(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._cancelClusterBrowsing(),this._clearBrowsedClusterGraphics(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new b;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:r,includeDefaultActions:o,selectedFeature:n}=this,a=o?s.concat(t):t,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(r)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(a)??a;return h?.filter(i).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new b;return e.removeAll(),e.addMany(L(this.selectedFeature)?V():G()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=w(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),d(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??S}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],clusterFeatures:null,content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){this._cancelClusterBrowsing(),j(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;if("2d"!==e?.type)return void o.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t);if(!L(t))return void o.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t);this._cancelClusterBrowsing();const i=new AbortController,{signal:s}=i;this._clusterBrowsingController=i;try{await Promise.allSettled([x(this,{signal:s}),j(this,{signal:s})])}finally{this._clusterBrowsingController===i&&(this._clusterBrowsingController=null)}}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:s}=this,r=i&&e.length;"list"!==this.initialDisplayMode?r&&t&&-1===s?this.selectedFeatureIndex=0:r&&-1!==s||(this.selectedFeatureIndex=e.length?0:-1):(!r||r&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=E(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:r}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:r}}).catch(e=>{l(e)||o.getLogger(this).error(e)}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(L(this.selectedFeature))return this.browseClusterEnabled=!1,this.open=!1,void this.clear();this.browseClusterEnabled&&(this.clusterFeatures=null)}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureItems:r}=this;if(null==i)return;const o=((i-1)*s+t)%t,n=o+s;r.slice(o,n).forEach((t,i)=>{t&&(t.graphic??=e[o+i])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),L(e))return;return e.symbol=await U(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=C(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await U(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,s=this.view,r=this.spatialReference,o=this.map,n=this.timeZone,a=this.location,l=this.featureItemAbilities??new O;if(L(t[0])||(this.browseClusterEnabled=!1),!t?.length)return void this._destroyFeatureItems();const u=i.slice(),h=[];t.forEach((t,i)=>{if(!t)return;const c=u.findIndex(e=>e?.graphic===t);if(-1!==c){const e=u[c];u.splice(c,1),e.abilities=l,h[i]=e}else{const u=new R({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:a,map:o,view:s,timeZone:n});h[i]=u}}),u.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await s.when();const r=e?.spatialReference;return r&&i?(await y(r,i,null,t),s.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=n(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===s&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(H),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{l(e)||o.getLogger(this).error(e)})),c(()=>!this.open,()=>{this.removeHandles(H)},{once:!0})],H);const{pendingFeatures:s}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:s}}async _locationUpdate(e,t){const{spatialReference:i}=this,s=this.selectedFeature?.geometry?.type,r=this.location??e;if(s&&"mesh"!==s&&i&&r&&this.selectedFeature){if("point"===s){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let s=e.geometry;const o=this._getHighlightLayer(e),n=e.getObjectId();if(!o||!this.view)return;if(n){const e=this.view?.allLayerViews.find(e=>e.layer.uid===o.uid);if(!e||!("queryFeatures"in e))return;const r=e.createQuery();r.outSpatialReference=i,r.objectIds=[n],r.returnGeometry=!0;const{features:a}=await e.queryFeatures(r,t);s=a[0]?.geometry}if(!s||"mesh"===s.type)return;s=_(s,i),D??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=D;if(!a.execute(s,r)){const t=l.getNearestCoordinate(s,r).coordinate??r;this.selectedFeature===e&&(this.location=t)}}catch(n){l(n)||o.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}_cancelClusterBrowsing(){this._clusterBrowsingController=n(this._clusterBrowsingController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=C(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(Z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||v:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:s,view:r,open:o}=this;if(!r||!s||!o)return;const n=this._getHighlightLayer(i);if(!n)return;const a=this._getHighlightLayerView(r,n);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&T(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter(e=>!t.includes(e));i?.length&&(this.features=t.concat(i))}};e([g()],z.prototype,"_fetchFeaturesController",void 0),e([g({type:b})],z.prototype,"actions",void 0),e([g({readOnly:!0})],z.prototype,"active",null),e([g()],z.prototype,"activeFeature",void 0),e([g({readOnly:!0})],z.prototype,"allActions",null),e([g()],z.prototype,"browseClusterEnabled",void 0),e([g({value:null})],z.prototype,"content",null),e([g({type:b,readOnly:!0})],z.prototype,"defaultActions",null),e([g({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],z.prototype,"featureCount",null),e([g()],z.prototype,"featurePage",void 0),e([g({value:[]})],z.prototype,"features",null),e([g()],z.prototype,"clusterFeatures",void 0),e([g()],z.prototype,"featuresPerPage",void 0),e([g()],z.prototype,"featureMenuOpen",void 0),e([g({type:O})],z.prototype,"featureItemAbilities",void 0),e([g({readOnly:!0})],z.prototype,"featureItems",void 0),e([g()],z.prototype,"heading",void 0),e([g()],z.prototype,"highlightEnabled",void 0),e([g()],z.prototype,"includeDefaultActions",void 0),e([g({value:"feature"})],z.prototype,"initialDisplayMode",null),e([g({type:f})],z.prototype,"location",null),e([g()],z.prototype,"map",null),e([g()],z.prototype,"open",void 0),e([g({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([g({readOnly:!0})],z.prototype,"promiseCount",null),e([g()],z.prototype,"promises",null),e([g({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([g({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([g({value:-1})],z.prototype,"selectedFeatureIndex",null),e([g({readOnly:!0})],z.prototype,"selectedFeatureItem",null),e([g({type:F})],z.prototype,"spatialReference",null),e([g({readOnly:!0})],z.prototype,"state",null),e([g()],z.prototype,"timeZone",null),e([g()],z.prototype,"updateLocationEnabled",void 0),e([g()],z.prototype,"view",void 0),e([g({readOnly:!0})],z.prototype,"waitingForContents",null),e([g({readOnly:!0})],z.prototype,"waitingForResult",null),e([g()],z.prototype,"zoomFactor",void 0),z=e([m("esri.popup.Features")],z);const N=z;export{N as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import s from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as n,isAbortError as a}from"../core/promiseUtils.js";import l from"../core/ReactiveSet.js";import{watch as h,when as u,sync as c}from"../core/reactiveUtils.js";import{addMany as p}from"../core/SetUtils.js";import{property as d,subclass as g}from"../core/accessorSupport/decorators.js";import m from"../geometry/Point.js";import{initializeProjection as f,project as y}from"../geometry/projectionUtils.js";import _ from"../geometry/SpatialReference.js";import{geographicToWebMercator as F}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as w}from"../layers/LayerConstants.js";import{ActionsCollection as C,zoomToClusteredFeatures as b,browseClusteredFeatures as I,zoomToFeature as P}from"./actions.js";import{isClusterFeature as A,getSelectedTarget as L}from"./actionUtils.js";import j from"./Feature.js";import x from"./support/FeatureAbilities.js";import{getDisplayedSymbol as E}from"../symbols/support/symbolUtils.js";import{system as R}from"../time/constants.js";import{highlightsSupported as O}from"../views/support/layerViewUtils.js";import{GoTo as U}from"../widgets/support/GoTo.js";const S="location-scale-handle",T=()=>[P.clone()],H=()=>[b.clone(),I.clone()];let M=null;function D(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let V=class extends(U(r)){constructor(e){super(e),this._pendingPromises=new l,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this.actions=new C,this.activeFeature=null,this.browseClusterEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),u(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>this.view?.scale,()=>this._viewScaleChange()),u(()=>!this.open,()=>this.browseClusterEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new C;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:o,selectedFeature:n}=this,a=o?r.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(s)||n.popupTemplate),h=l?.actions,u=l?.overwriteActions?h:h?.concat(a)??a;return u?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new C;return e.removeAll(),e.addMany(A(this.selectedFeature)?H():T()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,r=e?.spatialReference?.isWGS84;r&&i&&(t=F(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),p(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??R}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i&&e.length;"list"!==this.initialDisplayMode?s&&t&&-1===r?this.selectedFeatureIndex=0:s&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!s||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=L(this);this._cancelCenterAtLocation();const r=new AbortController,{signal:o}=r;return this._centerAtLocationController=r,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:o}}).catch(e=>{a(e)||s.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_viewScaleChange(){if(A(this.selectedFeature))return this.browseClusterEnabled=!1,this.open=!1,void this.clear()}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const o=((i-1)*r+t)%t,n=o+r;s.slice(o,n).forEach((t,i)=>{t&&(t.graphic??=e[o+i])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.browseClusterEnabled=!1,!e||!r)return;const s=v(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await E(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,o=this.map,n=this.timeZone,a=this.location,l=this.featureItemAbilities??new x;if(!t?.length)return void this._destroyFeatureItems();const h=i.slice(),u=[];t.forEach((t,i)=>{if(!t)return;const c=h.findIndex(e=>e?.graphic===t);if(-1!==c){const e=h[c];h.splice(c,1),e.abilities=l,u[i]=e}else{const h=new j({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:a,map:o,view:r,timeZone:n});u[i]=h}}),h.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:r}=this;if(!r)return null;await r.when();const s=e?.spatialReference;return s&&i?(await f(s,i,null,t),r.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=o(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:r}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:r}),{signal:r,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const r=new AbortController,{signal:s}=r;this._fetchFeaturesController=r;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===r&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(S),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{a(e)||s.getLogger(this).error(e)})),u(()=>!this.open,()=>{this.removeHandles(S)},{once:!0})],S);const{pendingFeatures:r}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:r}}async _locationUpdate(e,t){const{spatialReference:i}=this,r=this.selectedFeature?.geometry?.type,o=this.location??e;if(r&&"mesh"!==r&&i&&o&&this.selectedFeature){if("point"===r){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let r=e.geometry;const s=this._getHighlightLayer(e),n=e.getObjectId();if(!s||!this.view)return;if(n){const e=this.view?.allLayerViews.find(e=>e.layer.uid===s.uid);if(!e||!("queryFeatures"in e))return;const o=e.createQuery();o.outSpatialReference=i,o.objectIds=[n],o.returnGeometry=!0;const{features:a}=await e.queryFeatures(o,t);r=a[0]?.geometry}if(!r||"mesh"===r.type)return;r=y(r,i),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=M;if(!a.execute(r,o)){const t=l.getNearestCoordinate(r,o).coordinate??o;this.selectedFeature===e&&(this.location=t)}}catch(n){a(n)||s.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=v(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(D(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||w:null,o=e.attributes;return o&&s&&o[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:o}=this;if(!s||!r||!o)return;const n=this._getHighlightLayer(i);if(!n)return;const a=this._getHighlightLayerView(s,n);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&O(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const h=l.highlight(this._getHighlightTarget(i,n,s.type));this.addHandles(h,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter(e=>!t.includes(e));i?.length&&(this.features=t.concat(i))}};e([d()],V.prototype,"_fetchFeaturesController",void 0),e([d({type:C})],V.prototype,"actions",void 0),e([d({readOnly:!0})],V.prototype,"active",null),e([d()],V.prototype,"activeFeature",void 0),e([d({readOnly:!0})],V.prototype,"allActions",null),e([d()],V.prototype,"browseClusterEnabled",void 0),e([d({value:null})],V.prototype,"content",null),e([d({type:C,readOnly:!0})],V.prototype,"defaultActions",null),e([d({type:Boolean})],V.prototype,"defaultPopupTemplateEnabled",void 0),e([d({readOnly:!0})],V.prototype,"featureCount",null),e([d()],V.prototype,"featurePage",void 0),e([d({value:[]})],V.prototype,"features",null),e([d()],V.prototype,"featuresPerPage",void 0),e([d()],V.prototype,"featureMenuOpen",void 0),e([d({type:x})],V.prototype,"featureItemAbilities",void 0),e([d({readOnly:!0})],V.prototype,"featureItems",void 0),e([d()],V.prototype,"heading",void 0),e([d()],V.prototype,"highlightEnabled",void 0),e([d()],V.prototype,"includeDefaultActions",void 0),e([d({value:"feature"})],V.prototype,"initialDisplayMode",null),e([d({type:m})],V.prototype,"location",null),e([d()],V.prototype,"map",null),e([d()],V.prototype,"open",void 0),e([d({readOnly:!0})],V.prototype,"pendingPromisesCount",null),e([d({readOnly:!0})],V.prototype,"promiseCount",null),e([d()],V.prototype,"promises",null),e([d({value:null,readOnly:!0})],V.prototype,"selectedFeature",null),e([d({value:-1})],V.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],V.prototype,"selectedFeatureItem",null),e([d({type:_})],V.prototype,"spatialReference",null),e([d({readOnly:!0})],V.prototype,"state",null),e([d()],V.prototype,"timeZone",null),e([d()],V.prototype,"updateLocationEnabled",void 0),e([d()],V.prototype,"view",void 0),e([d({readOnly:!0})],V.prototype,"waitingForContents",null),e([d({readOnly:!0})],V.prototype,"waitingForResult",null),e([d()],V.prototype,"zoomFactor",void 0),V=e([g("esri.popup.Features")],V);const Z=V;export{Z as default};
|
package/popup/actionUtils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getGraphicLayer as
|
|
2
|
+
import{getGraphicLayer as t}from"../graphic/graphicOriginUtils.js";function e(t){const{selectedFeature:e,location:r,view:n}=t;return n?e??r??null:null}function r(e){if(!e)return!1;const r=t(e);return e.isAggregate&&"cluster"===r?.featureReduction?.type}export{e as getSelectedTarget,r as isClusterFeature};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleType as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as t}from"../../layers/support/LayerLoadContext.js";import{
|
|
2
|
+
import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleType as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as t}from"../../layers/support/LayerLoadContext.js";import{layersLoaderMap as s}from"../../layers/support/layersLoader.js";import{sceneServiceLayerTypeToClassName as n,applyPreferredHostToPortalItem as c,getPreferredHost as o}from"../../layers/support/layerUtils.js";import i from"../PortalItem.js";import{getFirstLayerOrTable as u,getNumLayersAndTables as l,preprocessFSItemData as y,getLayerOrTable as m,layerTypeToLayerModuleType as f,populateSceneServiceItemData as p}from"./loadUtils.js";import{hasTypeKeyword as d}from"./portalItemUtils.js";async function L(e){let{portalItem:a}=e;!a||a instanceof i||(a=new i(a));const r=await w(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function w(e){await e.load();const a=new t;return N(await S(e,a))}async function S(a,r){switch(a.type){case"3DTiles Service":return a.typeKeywords.includes("3DObject")?F():a.typeKeywords.includes("GaussianSplat")?b():P();case"CSV":return K();case"Feature Collection":return M(a);case"Feature Service":return h(a,r);case"Feed":return J();case"GeoJson":return G();case"Group Layer":return k();case"Image Service":return g(a,r);case"KML":return V();case"Knowledge Graph Layer":return W();case"Map Service":return v(a,r);case"Media Layer":return $();case"Scene Service":return I(a,r);case"Stream Service":return j();case"Video Service":return T(a,r);case"Vector Tile Service":return C();case"WCS":return U();case"WFS":return D();case"WMS":return O();case"WMTS":return x();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function N(e){const a=e.className,r=s[a];return{constructor:await r(),properties:e.properties}}async function v(e,a){return await A(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function h(e,a){const r=await E(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}async function I(e,r){const t=await E(e,r,async()=>{try{if(!e.url)return[];const{serverUrl:t}=await a(e.url,{sceneLayerItem:e}),s=await r.fetchServiceMetadata(t);return s?.tables??[]}catch{return[]}});if("object"==typeof t){const a={};let s;if(null!=t.id?(a.layerId=t.id,s=`${e.url}/layers/${t.id}`):s=e.url,e.typeKeywords?.length)for(const r of Object.keys(n))if(e.typeKeywords.includes(r))return{className:n[r]};const c=await r.fetchServiceMetadata(s,{customParameters:await r.fetchCustomParameters(e,e=>u(e)?.customParameters)});return{className:n[c?.layerType]||"SceneLayer",properties:a}}if(!1===t){const a=await r.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function M(e){await e.load();const a=d(e,"Map Notes"),r=d(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(d(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===l(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function g(e,a){await e.load();const r=e.typeKeywords?.map(e=>e.toLowerCase())??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),s=t?.layerType;if("ArcGISTiledImageServiceLayer"===s)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===s)return{className:"ImageryLayer"};const n=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),o=n.capabilities?.toLowerCase().includes("tilesonly"),i=n.tileInfo?.format?.toLowerCase()??"",u=null==c&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i);return"map"===c||u||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function j(){return{className:"StreamLayer"}}async function T(e,a){return"object"==typeof await E(e,a)?{className:"VideoLayer"}:{className:"GroupLayer"}}function C(){return{className:"VectorTileLayer"}}function G(){return{className:"GeoJSONLayer"}}function P(){return{className:"IntegratedMesh3DTilesLayer"}}function b(){return{className:"GaussianSplatLayer"}}function F(){return{className:"UnsupportedLayer"}}function K(){return{className:"CSVLayer"}}function V(){return{className:"KMLLayer"}}function W(){return{className:"KnowledgeGraphLayer"}}function U(){return{className:"WCSLayer"}}function D(){return{className:"WFSLayer"}}function O(){return{className:"WMSLayer"}}function x(){return{className:"WMTSLayer"}}function J(){return{className:"StreamLayer"}}function k(){return{className:"GroupLayer"}}function $(){return{className:"MediaLayer"}}async function A(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}async function E(e,a,t){const{url:s,type:n}=e,i="Feature Service"===n;if(!s)return{};if(/\/\d+$/.test(s)){if(i){const t=await a.fetchServiceMetadata(s,{customParameters:await a.fetchCustomParameters(e,e=>u(e)?.customParameters)});return c(e,o()),{id:t.id,className:r(t.type),sourceJSON:t}}return{}}if("Video Service"===n){const e=await a.fetchServiceMetadata(s);return!((e.layers?.length??0)>1)&&{}}await e.load();let d=await a.fetchItemData(e);if(i){const{data:r,preferredHost:t}=await y(d,s,a);c(e,t);const n=R(r);if("object"==typeof n){const e=m(r,n.id);n.className=f(e?.layerType)}return n}"Scene Service"===n&&(d=await p(e,d,a));if(l(d)>0)return R(d);const L=await a.fetchServiceMetadata(s);return t&&(L.tables=await t()),R(L)}function R(e){return 1===l(e)&&{id:u(e)?.id}}export{L as fromItem,S as selectLayerClassPath};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";let s=class extends t{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1,this.dataModelTimestamp=null}};e([r()],s.prototype,"headerKeys",void 0),e([r()],s.prototype,"outSpatialReference",void 0),e([r()],s.prototype,"exceededTransferLimit",void 0),e([r()],s.prototype,"dataModelTimestamp",void 0),s=e([o("esri.rest.knowledgeGraph.GraphQueryResultHeader")],s);export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Logger.js";import t from"../../../geometry/SpatialReference.js";import n from"../Entity.js";import r from"../GraphObject.js";import o from"../GraphQueryResultHeader.js";import s from"../ObjectValue.js";import
|
|
2
|
+
import e from"../../../core/Logger.js";import t from"../../../geometry/SpatialReference.js";import n from"../Entity.js";import r from"../GraphObject.js";import o from"../GraphQueryResultHeader.js";import s from"../ObjectValue.js";import a from"../Path.js";import u from"../Relationship.js";import{wasmToPolygonGeometry as i,wasmToPolylineGeometry as c,wasmToMultipointGeometry as l,wasmToPointGeometry as p}from"./wasmToGeometryFactories.js";const d=()=>e.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),m={decodedWasmObjToQueryResponseObj:(e,t,n)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case 1:return p(e,n);case 2:return l(e,n);case 3:return c(e,n);case 4:return i(e,n);case 5:case 7:return d().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;default:return d().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return d().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case 0:return h(e,t,n);case 1:return y(e,t,n);case 2:return b(e,t,n);case 3:return w(e,t,n);case 4:return _(e,t,n);default:return d().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function _(e,t,n){const r=[],o=e.count();for(let s=0;s<o;s++){const o=e.get_value_at(s);r.push(f(o,t,n))}return r}function f(e,t,n){return m.decodedWasmObjToQueryResponseObj(e,t,n)}function y(e,t,r){const o=e.type_name,s=j(e,t,r),a=e.get_id();return new n(Object.assign({typeName:o,id:a},s))}function g(e,t,n){return new r(j(e,t,n))}function j(e,t,n){const r={},o=e.key_count();for(let s=0;s<o;s++)r[e.get_key_at(s)]=f(e.get_value_at(s),t,n);return{properties:r}}function h(e,t,n){return new s(j(e,t,n))}function w(e,t,n){const r=e.entity_count(),o=e.relationship_count(),s=[];for(let a=0;a<r;a++)s.push(y(e.get_entity_at(a),t,n)),a<o&&s.push(b(e.get_relationship_at(a),t,n));return new a({path:s})}function b(e,t,n){const r=e.type_name,o=j(e,t,n);return new u(Object.assign({typeName:r,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}function O(e){const n=[];for(let t=0;t<e.get_header_keys().size();t++)n.push(e.get_header_keys().get(t));const r=new t(e.get_out_sr());return new o({headerKeys:n,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit(),dataModelTimestamp:e.data_model_timestamp?new Date(e.data_model_timestamp):null})}export{m as decodeWasmObjectTest,f as decodedWasmObjToQueryResponseObj,_ as wasmArrayToArray,y as wasmToEntity,g as wasmToGraphObject,O as wasmToGraphQueryResponseHeader,h as wasmToObjectValue,w as wasmToPath,b as wasmToRelationship};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const c="
|
|
2
|
+
const c="20260412",f="2f2ca2bf8574ec11c8af0fccbea7f3c4d15b5318";export{c as buildDate,f as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{cyrb53 as e}from"../../../../../../core/string.js";import{discardUrlIfHasUrlHash as t}from"../../urlUtils.js";import{AResourceProxy as r}from"../../shaderGraph/techniques/mesh/AResourceProxy.js";class s extends r{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingRequests=new Map,this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(r){const s=t(r.resource),o=e(JSON.stringify(s));return this._pendingRequests.has(o)||this._pendingRequests.set(o,r),o}async fetchEnqueuedResources(){const e=Array.from(this._pendingRequests.entries()),t=e.map(e=>e[1]);if(0===t.length)return;const r=await this._fetcher.fetch(t,this._abortOptions);for(let s=0;s<r.length;s++){const t=e[s][0];this._resourceIdToResource.set(t,r[s])}this._pendingRequests.clear()}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}getResource(e){return this._resourceIdToResource.get(e)}}export{s as ResourceProxy};
|