@arcgis/core 4.29.5 → 4.29.6
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/{863d14c98737482f6788.js → 0700231efdaf7ce06d19.js} +1 -1
- package/assets/esri/core/workers/chunks/{2146f7e55911da806aec.js → 2ca0fc695c66640a57dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{90b36361651839b1e3f0.js → 326aa2951f7e4da6d6b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{1251638c842dcf895ffe.js → 37133cf60bc9039a7407.js} +1 -1
- package/assets/esri/core/workers/chunks/{de6d54df7ae32694fd70.js → 534abb4408b15ac778dd.js} +1 -1
- package/assets/esri/core/workers/chunks/a068f0c8c1c632e8b2cb.js +1 -0
- package/assets/esri/core/workers/chunks/{2621b755fa5403bd8a4c.js → e232f6fca5629ae66dcc.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e56ff6978ba8d9cf0c0.js → f74eec62bcf3264e2d90.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a9387483b19a5ec5b86.js → fc5ac713872766571e07.js} +1 -1
- package/assets/esri/themes/base/widgets/_LayerList.scss +2 -0
- 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/core/workers/InvokeHandler.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/utils.js +1 -1
- package/interfaces.d.ts +47 -35
- package/kernel.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/widgets/LayerList/support/layerListUtils.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/5db9739e00f15613d1ea.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function
|
|
5
|
+
import{ignoreConnectionErrors as t}from"./utils.js";function n(n,e,i){return new Proxy({},{get:(o,s,l)=>(...o)=>{let l,a;const g=o[o.length-1];r(g)&&(l=g.signal,a=g.transferList,o.pop());const c=n.apply(e?`${e}.${s.toString()}`:s.toString(),o,{transferList:a,signal:l});return i?.ignoreConnectionErrors?t(c):c}})}function r(t){return"object"==typeof t&&!Array.isArray(t)&&null!=t&&("signal"in t||"transferList"in t||0===Object.keys(t).length)}export{n as createInvokeProxy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fullVersion as e}from"../../kernel.js";import s from"../Error.js";import{on as t}from"../events.js";import{makeHandle as o}from"../handleUtils.js";import{removeMaybe as n}from"../maybe.js";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from"../promiseUtils.js";import{createInvokeProxy as c}from"./InvokeHandler.js";import{registry as p}from"./registry.js";import{
|
|
5
|
+
import{fullVersion as e}from"../../kernel.js";import s from"../Error.js";import{on as t}from"../events.js";import{makeHandle as o}from"../handleUtils.js";import{removeMaybe as n}from"../maybe.js";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from"../promiseUtils.js";import{createInvokeProxy as c}from"./InvokeHandler.js";import{registry as p}from"./registry.js";import{portClosedErrorName as _,newJobId as u,MessageType as d,receiveMessage as b,toInvokeError as m,postMessage as g}from"./utils.js";import{buildDate as f,commitHash as v}from"../../support/revision.js";const{CLOSE:M,ABORT:k,INVOKE:j,RESPONSE:y,OPEN_PORT:I,ON:J}=d,w=2;class O{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===d.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class E{static connect(e){const s=new MessageChannel;let t;t="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new E(s.port1,{channel:s,client:t});return"object"==typeof t&&"remoteClient"in t&&(t.remoteClient=o),E.clients.set(o,t),s.port2}static loadWorker(e){const s=p[e];return s?s():Promise.resolve(null)}constructor(e,s,t){this._port=e,this._jobQueue=t,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new O((e=>this._onInvokeMessage(e))),this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,this._schedule=s.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:M}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,s,t){return this.apply(e,[s],t)}apply(e,t,o){const a=o?.signal,h=o?.transferList;if(!this._port)return Promise.reject(new s(_,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=u();return new Promise(((s,o)=>{if(r(a))return this._processWork(),void o(i());const p=l(a,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),n(e.abortHandle),this._post({type:k,jobId:c}),o(i()))})),_={resolve:s,reject:o,abortHandle:p,debugInfo:e};this._outJobs.set(c,_),this._post({type:j,jobId:c,methodName:e,abortable:null!=a},t,h)}))}createInvokeProxy(e,s){return c(this,e,s)}on(e,s){const t=new MessageChannel;function n(e){s(e.data)}return this._port.postMessage({type:d.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener("message",n),t.port1.start(),o((()=>{t.port1.postMessage({type:d.CLOSE}),t.port1.close(),t.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:I,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=w)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:s,data:t,invokeOptions:o,resolver:n}=e;this.apply(s,t,o).then((e=>n.resolve(e))).catch((e=>n.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{n(e.abortHandle),e.reject(i(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const s=b(e);if(s)switch(s.type){case y:this._onResponseMessage(s);break;case j:this._invokeQueue.push(s);break;case k:this._onAbortMessage(s);break;case M:this._onCloseMessage();break;case I:this._onOpenPortMessage(s);break;case J:this._onOnMessage(s)}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&E.clients.get(this)===e&&e.destroy(),E.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o=[],abortable:n}=e,r=n?new AbortController:null,i=this._inJobs;let l,c=this._client,p=c[s];try{if(!p&&s&&s.includes(".")){const e=s.split(".");for(let s=0;s<e.length-1;s++)c=c[e[s]],p=c[e[s+1]]}if("function"!=typeof p)throw new TypeError(`${s} is not a function`);o.push({client:this,signal:r?r.signal:null}),l=p.apply(c,o)}catch(_){return void this._post({type:y,jobId:t,error:m(_)})}a(l)?(i.set(t,{controller:r,promise:l}),l.then((e=>{i.has(t)&&(i.delete(t),this._post({type:y,jobId:t},e))}),(e=>{i.has(t)&&(i.delete(t),h(e)||this._post({type:y,jobId:t,error:m(e||{message:`Error encountered at method ${s}`})}))}))):this._post({type:y,jobId:t},l)}_onOpenPortMessage(e){new E(e.port,{client:this._client})}_onOnMessage(e){const{port:s}=e,o=this._client.on(e.eventType,(e=>{s.postMessage(e)})),n=t(e.port,"message",(e=>{const t=b(e);t?.type===d.CLOSE&&(n.remove(),o.remove(),s.close())}))}_onResponseMessage(e){const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const l=i.get(t);i.delete(t),this._processWork(),n(l.abortHandle),o?l.reject(s.fromJSON(JSON.parse(o))):l.resolve(r)}_post(e,s,t){return g(this._port,e,s,t)}}E.kernelInfo={buildDate:f,fullVersion:e,revision:v},E.clients=new Map;export{E as default};
|
package/core/workers/utils.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.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../has.js";var
|
|
5
|
+
import has from"../has.js";import{isAbortError as t}from"../promiseUtils.js";const r="worker:port-closed";var e;!function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"}(e||(e={}));let n=0;function s(){return n++}function o(t){return t&&"object"==typeof t&&("result"in t||"transferList"in t)}function i(t){return t?"string"==typeof t?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function a(t,r,n,s){if(r.type===e.OPEN_PORT)return void t.postMessage(r,[r.port]);if(r.type!==e.INVOKE&&r.type!==e.RESPONSE)return void t.postMessage(r);let f;if(o(n)?(f=u(n.transferList),r.data=n.result):(f=u(s),r.data=n),f){if(has("ff"))for(const n of f)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(r.type){case e.INVOKE:throw n;case e.RESPONSE:return void a(t,{type:e.RESPONSE,jobId:r.jobId,error:i(n)})}}t.postMessage(r,f)}else t.postMessage(r)}function f(t){if(!t)return null;const r=t.data;return r?"string"==typeof r?JSON.parse(r):r:null}function u(t){if(!t?.length)return null;if(has("esri-workers-arraybuffer-transfer"))return t;const r=t.filter((t=>!c(t)));return r.length?r:null}function c(t){return t instanceof ArrayBuffer||"ArrayBuffer"===t?.constructor?.name}async function O(e){try{return await e}catch(n){const e=n?.name===r;if(!(t(n)||e))throw n;return}}export{e as MessageType,O as ignoreConnectionErrors,o as isTransferrableResult,s as newJobId,r as portClosedErrorName,a as postMessage,f as receiveMessage,i as toInvokeError};
|
package/interfaces.d.ts
CHANGED
|
@@ -11350,6 +11350,12 @@ declare namespace __esri {
|
|
|
11350
11350
|
}
|
|
11351
11351
|
|
|
11352
11352
|
export class FeatureLayer {
|
|
11353
|
+
/**
|
|
11354
|
+
* Array of Chart Items of type WebMapWebChart available on the feature layer.
|
|
11355
|
+
*
|
|
11356
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#charts)
|
|
11357
|
+
*/
|
|
11358
|
+
charts: any[];
|
|
11353
11359
|
/**
|
|
11354
11360
|
* An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace.
|
|
11355
11361
|
*
|
|
@@ -11554,6 +11560,12 @@ declare namespace __esri {
|
|
|
11554
11560
|
}
|
|
11555
11561
|
|
|
11556
11562
|
interface FeatureLayerProperties extends LayerProperties, OrderedLayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties, BlendLayerProperties, CustomParametersMixinProperties, APIKeyMixinProperties, FeatureEffectLayerProperties, FeatureReductionLayerProperties, PublishableLayerProperties, OperationalLayerProperties, FeatureLayerBaseProperties {
|
|
11563
|
+
/**
|
|
11564
|
+
* Array of Chart Items of type WebMapWebChart available on the feature layer.
|
|
11565
|
+
*
|
|
11566
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#charts)
|
|
11567
|
+
*/
|
|
11568
|
+
charts?: any[];
|
|
11557
11569
|
/**
|
|
11558
11570
|
* An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace.
|
|
11559
11571
|
*
|
|
@@ -112094,12 +112106,12 @@ declare namespace __esri {
|
|
|
112094
112106
|
}
|
|
112095
112107
|
|
|
112096
112108
|
export interface SketchUpdateEvent {
|
|
112097
|
-
__4: "update";
|
|
112098
112109
|
aborted: boolean;
|
|
112099
112110
|
graphics: Graphic[];
|
|
112100
112111
|
state: "start" | "active" | "complete";
|
|
112101
112112
|
tool: "move" | "transform" | "reshape";
|
|
112102
112113
|
toolEventInfo: UpdateToolEventInfo;
|
|
112114
|
+
type: "update";
|
|
112103
112115
|
}
|
|
112104
112116
|
|
|
112105
112117
|
/**
|
|
@@ -119200,9 +119212,9 @@ declare namespace __esri {
|
|
|
119200
119212
|
/**
|
|
119201
119213
|
* Map of Service URLs and user type extensions.
|
|
119202
119214
|
*
|
|
119203
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119215
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#advancedEditingUserTypeExtensionLookup)
|
|
119204
119216
|
*/
|
|
119205
|
-
readonly
|
|
119217
|
+
readonly advancedEditingUserTypeExtensionLookup: globalThis.Map<string, boolean>;
|
|
119206
119218
|
/**
|
|
119207
119219
|
* Displays execution errors.
|
|
119208
119220
|
*
|
|
@@ -119212,15 +119224,9 @@ declare namespace __esri {
|
|
|
119212
119224
|
/**
|
|
119213
119225
|
* A key-value pair of [FeatureServiceResourcesBundle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#FeatureServiceResourcesBundle).
|
|
119214
119226
|
*
|
|
119215
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119216
|
-
*/
|
|
119217
|
-
featureServices: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
|
|
119218
|
-
/**
|
|
119219
|
-
* Collection of [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with versioning enabled that belong to the [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
|
|
119220
|
-
*
|
|
119221
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#layers)
|
|
119227
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServiceLookup)
|
|
119222
119228
|
*/
|
|
119223
|
-
|
|
119229
|
+
featureServiceLookup: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
|
|
119224
119230
|
/**
|
|
119225
119231
|
* Displays an error if loading fails.
|
|
119226
119232
|
*
|
|
@@ -119230,15 +119236,15 @@ declare namespace __esri {
|
|
|
119230
119236
|
/**
|
|
119231
119237
|
* Map of Service URLs and enterprise versions.
|
|
119232
119238
|
*
|
|
119233
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119239
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serverVersionLookup)
|
|
119234
119240
|
*/
|
|
119235
|
-
readonly
|
|
119241
|
+
readonly serverVersionLookup: globalThis.Map<string, number>;
|
|
119236
119242
|
/**
|
|
119237
119243
|
* Map of Service URLs and service names.
|
|
119238
119244
|
*
|
|
119239
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119245
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNameLookup)
|
|
119240
119246
|
*/
|
|
119241
|
-
|
|
119247
|
+
serviceNameLookup: globalThis.Map<string, string>;
|
|
119242
119248
|
/**
|
|
119243
119249
|
* The viewModel's state.
|
|
119244
119250
|
*
|
|
@@ -119248,21 +119254,27 @@ declare namespace __esri {
|
|
|
119248
119254
|
/**
|
|
119249
119255
|
* Map of Service URLs and logged in users.
|
|
119250
119256
|
*
|
|
119251
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119257
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#userLookup)
|
|
119252
119258
|
*/
|
|
119253
|
-
readonly
|
|
119259
|
+
readonly userLookup: globalThis.Map<string, string>;
|
|
119254
119260
|
/**
|
|
119255
119261
|
* Contains information about the versions in the versionmanagementservice such as name, guid, etc
|
|
119256
119262
|
*
|
|
119257
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119263
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfoLookup)
|
|
119258
119264
|
*/
|
|
119259
|
-
|
|
119265
|
+
versionInfoLookup: globalThis.Map<string, VersionInfo[]>;
|
|
119260
119266
|
/**
|
|
119261
119267
|
* This class contains metadata about the version management service.
|
|
119262
119268
|
*
|
|
119263
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119269
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServiceLookup)
|
|
119270
|
+
*/
|
|
119271
|
+
versionManagementServiceLookup: globalThis.Map<string, VersionManagementService>;
|
|
119272
|
+
/**
|
|
119273
|
+
* The view from which the widget will operate.
|
|
119274
|
+
*
|
|
119275
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#view)
|
|
119264
119276
|
*/
|
|
119265
|
-
|
|
119277
|
+
view: MapView;
|
|
119266
119278
|
/**
|
|
119267
119279
|
* This class allows you to manage versions from a variety of [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
|
|
119268
119280
|
*
|
|
@@ -119305,33 +119317,33 @@ declare namespace __esri {
|
|
|
119305
119317
|
/**
|
|
119306
119318
|
* A key-value pair of [FeatureServiceResourcesBundle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#FeatureServiceResourcesBundle).
|
|
119307
119319
|
*
|
|
119308
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119309
|
-
*/
|
|
119310
|
-
featureServices?: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
|
|
119311
|
-
/**
|
|
119312
|
-
* Collection of [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with versioning enabled that belong to the [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
|
|
119313
|
-
*
|
|
119314
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#layers)
|
|
119320
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServiceLookup)
|
|
119315
119321
|
*/
|
|
119316
|
-
|
|
119322
|
+
featureServiceLookup?: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
|
|
119317
119323
|
/**
|
|
119318
119324
|
* Map of Service URLs and service names.
|
|
119319
119325
|
*
|
|
119320
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119326
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNameLookup)
|
|
119321
119327
|
*/
|
|
119322
|
-
|
|
119328
|
+
serviceNameLookup?: globalThis.Map<string, string>;
|
|
119323
119329
|
/**
|
|
119324
119330
|
* Contains information about the versions in the versionmanagementservice such as name, guid, etc
|
|
119325
119331
|
*
|
|
119326
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119332
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfoLookup)
|
|
119327
119333
|
*/
|
|
119328
|
-
|
|
119334
|
+
versionInfoLookup?: globalThis.Map<string, VersionInfo[]>;
|
|
119329
119335
|
/**
|
|
119330
119336
|
* This class contains metadata about the version management service.
|
|
119331
119337
|
*
|
|
119332
|
-
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#
|
|
119338
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServiceLookup)
|
|
119339
|
+
*/
|
|
119340
|
+
versionManagementServiceLookup?: globalThis.Map<string, VersionManagementService>;
|
|
119341
|
+
/**
|
|
119342
|
+
* The view from which the widget will operate.
|
|
119343
|
+
*
|
|
119344
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#view)
|
|
119333
119345
|
*/
|
|
119334
|
-
|
|
119346
|
+
view?: MapViewProperties;
|
|
119335
119347
|
}
|
|
119336
119348
|
|
|
119337
119349
|
/**
|
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.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.6";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
|
package/package.json
CHANGED
package/support/revision.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.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20240306",f="856686c0c7ca2d7c3b79a28ff4a12ff8c06d2451";export{c as buildDate,f as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{AttributeDataType as s,filterFlagsUnit as r,animationUnit as n,gpgpuUnit as a,visualVariableUnit as o,dataDrivenUnit0 as u,dataDrivenUnit1 as h,dataDrivenUnit2 as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as
|
|
5
|
+
import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{AttributeDataType as s,filterFlagsUnit as r,animationUnit as n,gpgpuUnit as a,visualVariableUnit as o,dataDrivenUnit0 as u,dataDrivenUnit1 as h,dataDrivenUnit2 as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as c}from"./Utils.js";import{TextureWrapMode as _,TextureSamplingMode as g}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=_.CLAMP_TO_EDGE,t.samplingMode=g.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=l(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=l(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),o=4,u=(s-s%this.size)/this.size,h=(r-r%this.size)/this.size,d=u,l=this.size,c=h,_=u*this.size*o,g=(l+c*this.size)*o-_,x=p(this.pixelType),f=new x(n,_*x.BYTES_PER_ELEMENT,g),b=this.size,m=c-d+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),o=c(r),u=new(p(r))(new ArrayBuffer(i*s*o*this.texelSize)),h=t.getBoundFramebufferObject(),{x:d,y:l,width:_,height:g}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,u),e.updateData(0,0,0,2*i,s/2,u),t.setViewport(d,l,_,g),t.bindFramebuffer(h)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose();for(const{resolver:t}of this._pendingAttributeUpdates)t.reject("AttributeStore destroyed");this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,s.VV,0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}async requestUpdate(t){const e=i();e.promise=e.promise.catch((t=>{has("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",t)})),this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:e,resolver:i}of t){const{blockData:t,initArgs:s,sendUpdateEpoch:r,version:n}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${r}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=r,null!=s&&this._initialize(s);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}i.resolve()}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,s.FilterFlags),unit:r},animation:{texture:this._getTexture(t,s.Animation),unit:n},gpgpu:{texture:this._getTexture(t,s.GPGPU),unit:a},visualVariableData:{texture:this._getTexture(t,s.VV),unit:o},dataDriven0:{texture:this._getTexture(t,s.DD0),unit:u},dataDriven1:{texture:this._getTexture(t,s.DD1),unit:h},dataDriven2:{texture:this._getTexture(t,s.DD2),unit:d},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=_.CLAMP_TO_EDGE,e.samplingMode=g.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{
|
|
5
|
+
import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{clipMarshall as t}from"../../../mesh/templates/templateUtils.js";import{FillMeshWriter as r}from"./FillMeshWriter.js";import{processColorInput as s,packBitset as i}from"./meshWriterUtils.js";import{LineVertexSpec as o,LineMeshWriter as n}from"../line/LineMeshWriter.js";import{getLineClippingMargin as a}from"../mesh/utils.js";import{bitsetTypeFillOutline as u}from"../shaders/constants.js";import{DataType as c}from"../../../../../../webgl/enums.js";const l={createComputedParams:e=>e,attributes:{...o.attributes,bitset:{type:c.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:c.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>s(e)}}},m={createComputedParams:e=>e,attributes:{...o.attributes,bitset:{type:c.UNSIGNED_BYTE,count:1,pack:e=>i([[u,!0]])},color:{type:c.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>s(e)}}};class p extends n{constructor(){super(...arguments),this.vertexSpec=m}}class h extends r{constructor(e,t,r,s){super(e,t,r,s),this.vertexSpec=l,this._lineMeshWriter=this._createOutlineWriter(e,t,r,s)}_createOutlineWriter(e,t,r,s){return new p(e,t,r,s)}_write(t,r,s){const i=s?.asOptimized()??r.readGeometryForDisplay(),o=this._clip(i);o&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,r,o),this._lineMeshWriter.writeLineVertices(t,e.fromOptimizedCIM(o,"esriGeometryPolyline"),r),t.recordEnd())}_clip(e){return e?t(e,a(this.evaluatedMeshParams)):null}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}export{h as OutlineFillMeshWriter,p as OutlineFillOutlineMeshWriter,l as outlineFillVertexSpec_Fill,m as outlineFillVertexSpec_Outline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{minMaxZoomPrecisionFactor as s,thinLineHalfWidthThreshold as i}from"../../../definitions.js";import{LineTessellation as r}from"../../../TurboLine.js";import{clipLinesMarshall as o}from"../../../mesh/templates/templateUtils.js";import{getMinMaxZoom as n,processColorInput as a,packRounded as c,packCeil as h,processLineCapInput as l,processLineJoinInput as m}from"../fill/meshWriterUtils.js";import{MeshWriter as u}from"../mesh/MeshWriter.js";import{
|
|
5
|
+
import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{minMaxZoomPrecisionFactor as s,thinLineHalfWidthThreshold as i}from"../../../definitions.js";import{LineTessellation as r}from"../../../TurboLine.js";import{clipLinesMarshall as o}from"../../../mesh/templates/templateUtils.js";import{getMinMaxZoom as n,processColorInput as a,packRounded as c,packCeil as h,processLineCapInput as l,processLineJoinInput as m}from"../fill/meshWriterUtils.js";import{MeshWriter as u}from"../mesh/MeshWriter.js";import{getLineClippingMargin as p}from"../mesh/utils.js";import{DataType as d}from"../../../../../../webgl/enums.js";class f{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}}const _={createComputedParams:t=>t,attributes:{id:{type:d.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:d.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:d.UNSIGNED_BYTE,count:1},zoomRange:{type:d.SHORT,count:2,packPrecisionFactor:s,pack:({scaleInfo:t},{tileInfo:e})=>n(t,e)},color:{type:d.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>a(t)},offset:{type:d.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[c(t,16),c(e,16)]},normal:{type:d.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[c(t,16),c(e,16)]},halfWidth:{type:d.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:e})=>h(t(.5*e),16)},referenceHalfWidth:{type:d.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:e})=>h(t(.5*e),16)}}};class x{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}}const T=65535;class w extends u{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=_,this._currentWrite=new x,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:T,textured:!1},this._tessParams=new f,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);null!=i&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new r(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,s,i){const r=i??e.fromFeatureSetReaderCIM(s);r&&this._writeGeometry(t,s,r)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return o(t,p(this.evaluatedMeshParams))}_writeVertices(e,s,r){const{_currentWrite:o,_tessellationOptions:n,evaluatedMeshParams:a}=this,{width:c,capType:h,joinType:u,miterLimit:p,hasSizeVV:d}=a,f=t(.5*c);n.halfWidth=f,n.capType=l(h),n.joinType=m(u),n.miterLimit=p;const _=!d;o.out=e,o.id=s.getDisplayId(),o.vertexCount=0,o.indexCount=0,o.vertexFrom=e.vertexCount(),o.vertexBounds=_&&f<i?0:1;for(const{line:t,start:i}of r)n.initialDistance=i%T,this._lineTessellator.tessellate(t,n,_)}_writeTesselatedVertex(t,e,s,i,r,o,n,a,c,h,l){const{out:m,id:u,vertexBounds:p}=this._currentWrite;return this.hasEffects&&m.recordBounds(t,e,p,p),this._tessParams.extrusionOffsetX=n,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=c,this._tessParams.normalY=h,this._tessParams.directionX=r,this._tessParams.directionY=o,this._tessParams.distance=l,this._writeVertex(m,u,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}export{w as LineMeshWriter,f as LineTessellationParams,_ as LineVertexSpec};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{numericHash as e}from"../../../../../../../core/string.js";function
|
|
5
|
+
import{numericHash as e}from"../../../../../../../core/string.js";function t(t){const o=t.map((({name:e,count:t,type:o})=>`${e}.${t}.${o}`)).join(",");return e(o)}function o(e,t,r,i,n,a,c){if(e.primitiveName===t)for(const o in e)if(o===r){let t=i?.readWithDefault(n,a,e[o]&&c);return"text"===e.type&&(t=t.toString()),void(e[o]=t)}if("type"in e&&null!=e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.symbolLayers)for(const l of e.symbolLayers)o(l,t,r,i,n,a,c);break;case"CIMHatchFill":e.lineSymbol&&o(e.lineSymbol,t,r,i,n,a,c);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const l of e.markerGraphics)o(l,t,r,i,n,a,c),o(l.symbol,t,r,i,n,a,c)}}function r(e){const t=e.width;return null!=e.effects?256:Math.max(1.25*t,8)}export{o as applyComputedValue,r as getLineClippingMargin,t as vertexLayoutHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import"../../../../core/Logger.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as r,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/InstanceStore.js";import{RenderState as h}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";class l{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class u extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e}renderChildren(e){if(this.attributeView.update(),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);if(super.renderChildren(e),this.hasAnimation){e.painter.effects.integrate.draw(e,e.attributeView)}switch(e.drawPhase){case r.MAP:return this._renderMapPhase(e);case r.HIGHLIGHT:return this._renderHighlightPhase(e);case r.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(null==this._instanceStore)return null;let t=0,s=null;for(const i of this._instanceStore.values())i.techniqueRef.drawPhase&e&&(t++,i.techniqueRef.postProcessingEnabled&&(s=i));return t>1?null:s}_getOverrideStencilRef({drawPhase:e}){if(null==this._instanceStore)return null;let t=null;for(const s of this._instanceStore.values()){if(!(s.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:i}=s.techniqueRef;if(null==t)t=i;else if(t!==i){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new l(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new h(this._stage,e,this._tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const i of t)s.set(i.fieldName,{minValue:i.minValue,maxValue:i.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){if(this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const e of this._renderState.tiles())e.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){if(e(s),!this._subscriptions.has(t.id))return;const i=this._subscriptions.get(t.id);if(i.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const r=this._renderStateNext??this._renderState;if(!r)throw new Error("InternalError: No renderState defined");if(r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.updateTile(t),t.end){this._subscriptions.get(t.id).end()}this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const i=t();return s?s.resolvers.push(i):(s={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const i of this.children)if(i.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(null==t)super.setStencilReference(e);else for(const s of this.children)s.stencilRef=t(s)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,i=t.getBoundFramebufferObject(),r=t.getViewport(),a=e.passOptions;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,n.All),s.draw(e),s.unbind(),t.bindFramebuffer(i),t.restoreViewport(r),e.passOptions=a}_renderFeatures(e,t){for(const i of this.children){if(!i.visible)continue;const s=has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,r=i.getDisplayList(e.drawPhase,this._instanceStore,s);e.selection=t,r?.render(e)}const s=this._getExclusivePostprocessingInstance(e);null!=s&&s.techniqueRef.postProcess(e,s)}}export{u as FeatureContainer};
|
|
5
|
+
import has from"../../../../core/has.js";import"../../../../core/Logger.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as r,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/InstanceStore.js";import{RenderState as h}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";class l{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class u extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e}renderChildren(e){if(this.attributeView.update(),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);if(super.renderChildren(e),this.hasAnimation){e.painter.effects.integrate.draw(e,e.attributeView)}switch(e.drawPhase){case r.MAP:return this._renderMapPhase(e);case r.HIGHLIGHT:return this._renderHighlightPhase(e);case r.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(null==this._instanceStore)return null;let t=0,s=null;for(const i of this._instanceStore.values())i.techniqueRef.drawPhase&e&&(t++,i.techniqueRef.postProcessingEnabled&&(s=i));return t>1?null:s}_getOverrideStencilRef({drawPhase:e}){if(null==this._instanceStore)return null;let t=null;for(const s of this._instanceStore.values()){if(!(s.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:i}=s.techniqueRef;if(null==t)t=i;else if(t!==i){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new l(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new h((()=>this._stage),e,this._tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const i of t)s.set(i.fieldName,{minValue:i.minValue,maxValue:i.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){if(this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const e of this._renderState.tiles())e.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){if(e(s),!this._subscriptions.has(t.id))return;const i=this._subscriptions.get(t.id);if(i.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const r=this._renderStateNext??this._renderState;if(!r)throw new Error("InternalError: No renderState defined");if(r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.updateTile(t),t.end){this._subscriptions.get(t.id).end()}this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const i=t();return s?s.resolvers.push(i):(s={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const i of this.children)if(i.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(null==t)super.setStencilReference(e);else for(const s of this.children)s.stencilRef=t(s)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,i=t.getBoundFramebufferObject(),r=t.getViewport(),a=e.passOptions;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,n.All),s.draw(e),s.unbind(),t.bindFramebuffer(i),t.restoreViewport(r),e.passOptions=a}_renderFeatures(e,t){for(const i of this.children){if(!i.visible)continue;const s=has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,r=i.getDisplayList(e.drawPhase,this._instanceStore,s);e.selection=t,r?.render(e)}const s=this._getExclusivePostprocessingInstance(e);null!=s&&s.techniqueRef.postProcess(e,s)}}export{u as FeatureContainer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class e{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy(),this.container=this._client.createInvokeProxy("container"),this.eventLog=this._client.createInvokeProxy("eventLog")}}export{e as PipelineConnectionHandlers};
|
|
5
|
+
class e{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy("",{ignoreConnectionErrors:!0}),this.container=this._client.createInvokeProxy("container",{ignoreConnectionErrors:!0}),this.eventLog=this._client.createInvokeProxy("eventLog",{ignoreConnectionErrors:!0})}}export{e as PipelineConnectionHandlers};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{create as
|
|
5
|
+
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{create as i}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import s from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as o}from"../../engine/webgl/FeatureTile.js";import{getPow2NeighborKey as r}from"./support/tileUtils.js";class n{constructor(e,t,i){this.getStage=e,this.version=t,this._tileInfoView=i,this._tiles=new Map,this._pendingUpdates=[],this._locked=!1}destroy(){}tiles(){return this._tiles.values()}size(){return this._tiles.size}setTiles(e){this._tiles.clear();for(const t of e)this._tiles.set(t.key.id,t)}lockUploads(){this._locked=!0}unlockUploads(){this._locked=!1;for(const e of this._pendingUpdates)this.updateTile(e);this._pendingUpdates=[]}updateTile(e){if(this._locked)return void this._pendingUpdates.push(e);if(has("esri-2d-update-debug")){const t=e.debugInfo?.chunkId??"<EnsureEnd>";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${t}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if("update"===e.type){const[i,...s]=e.modify;t.onMessage({type:"update",modify:i,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const t of s){const i=this._tiles.get(t.tileId);i&&i.onMessage({type:"update",modify:t,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(null==e.append)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[i,...s]=e.append;t.onMessage({type:"append",clear:e.clear,append:i,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const o of s){const e=this._tiles.get(o.tileId);e&&e.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);has("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(r){has("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${r}] RenderState.createTile`);const n=new s(r),l=this._tileInfoView.getTileBounds(i(),n),d=this._tileInfoView.getTileResolution(n.level),a=new o(n,d,l[0],l[3],!0);if(a.stage=this.getStage(),!a.stage){const i=new e("featurelayerview:webgl","Cannot create tile with empty stage");t.getLogger("esri.views.2d.layers.features.RenderState").error(i)}return a}_copyPixelBufferedEntitiesInto(e){let t=7;for(let i=-1;i<=1;i++)for(let s=-1;s<=1;s++){if(0===i&&0===s)continue;const o=this._tileInfoView.tileInfo.isWrappable,n=r(e.key,s,i,o).id,l=this._tiles.get(n);if(null!=l){const o=1<<t;e.copyPixelBufferedEntitesFrom(l,o,s,i)}t--}}}export{n as RenderState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{
|
|
5
|
+
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as n}from"../../../../../support/QueueProcessor.js";class a extends r{constructor(e,t,r,o,a){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=o,this._eventLog=a,this._queue=new n({concurrency:16,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters};return this._adapter.executeQuery(e.query.inner,t)}}),this._adapter=s(e,o)}async updateFields(r){this._queryInfo.updateFields(r);const s=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),o=(await Promise.all(s)).filter((e=>e));if(o.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:o})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)null!=o.objectId&&-1!==o.objectId?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const s=e.addOrModified.map((({objectId:e})=>e));let n;if(s.length){const e=this._queryInfo.createQuery({objectIds:s});n=await this._fetch(e)}else n=o.empty(this._metadata);return{reader:n,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(null==r)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=[];return this._store.forEachUnsafe((e=>{const o=e.readAttribute(r);t.has(o)&&s.push(e.getObjectId())})),s}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e.fields);if(!r)return;const s=await this._enqueue(r,this._options);e.joinAttributes(s)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally((()=>{this._eventLog.onEvent({type:"fetchEnd",done:0===this._queue.length})}))}}export{a as AFetchLoadStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as m}from"../../../../core/string.js";import{dataComponents as u}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as _,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as x}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as b}from"../../../../support/arcadeOnDemand.js";import{CIMSymbolHelper as S}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as v}from"../../../../symbols/cim/OverrideHelper.js";import{evaluateValueOrFunction as P}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as z}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as R}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as M}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import w from"../../../2d/arcade/callExpressionWithFeature.js";import{transparentUnit as O}from"./constants.js";import{perObjectElevationAligner as j}from"./ElevationAligners.js";import{SymbolUpdateType as I,elevationModeChangeUpdateType as T,needsElevationUpdates2D as E}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as U}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A}from"./graphicUtils.js";import{ApplyRendererDiffResult as L}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as G}from"./placementUtils.js";import{placePointOnGeometry as V,createStageObject as H,extendPointGraphicElevationContext as k}from"./pointUtils.js";import{initFastSymbolUpdatesState as B,updateFastSymbolUpdatesState as N,evaluateModelTransformScale as W,ConvertOptions as $}from"../support/FastSymbolUpdates.js";import{createTexture as q,requiresHalfTexelOffset as J,defaultSymbolSizeRatio as Z,defaultTexSize as K}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as Q}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as X}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as Y}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as ee}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as te}from"../../webgl-engine/materials/HUDMaterial.js";const re=f(0,0,1),ie=16,se=1.5,oe=Z,ae=[oe/2,oe/2,1-oe/2,1-oe/2],ne=[K*oe,K*oe];class le extends F{getCachedSize(){return{size:this._getIconSize()}}constructor(e,t,r,i){super(e,t,r,i),this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbolLayer),i=u(r);i&&"application/json"===i.mediaType?await this._prepareResourcesCIM(t,JSON.parse(i.data),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):ie);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){let t=this._cimData;if(t&&t.symbol||this.logger.error("Can't create texture, CIM data is undefined"),t.primitiveOverrides){t=s(t);const r=t.primitiveOverrides;v.evaluateOverrides(r,e,this._arcadeInfo.geometryType,null,null),v.applyOverrides(t.symbol,r)}const r=m(JSON.stringify(t));let i=this._cimSymbolTextures.get(r);if(i)return i;const o=this._context.sharedResources.cimSymbolRasterizer,a=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;a&&v.applyDictionaryTextOverrides(t.symbol,e,a,null);const n=null!=this._cimScaleFactorOrFunction?P(this._cimScaleFactorOrFunction,e):1;1!==n&&t.symbol&&z(t.symbol,n,!0);const l=S.getEnvelope(t,null,o.resourceManager);if(l&&l.width&&l.height){const e=l.x+l.width/2,r=l.y+l.height/2,s=o.rasterize({type:"cim",data:t},l.width,l.height,e,r,1,"esriGeometryPoint"),a=new M({x:-l.x/l.width-.5,y:(l.height+l.y)/l.height-.5});this._cimMaterialParametersInfo.anchorPosition=this._getAnchorPos("relative",a),i=new ee(s,{width:s?.width??1,height:s?.height??1})}else i=new ee(new ImageData(1,1),{width:1,height:1});return this._cimSymbolTextures.set(r,i),this._context.stage.add(i),i}_prepareMaterialParameters(){const e={anchorPosition:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},t=this.symbol;if(ce(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(he(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>q(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=J(t),e.distanceFieldBoundingBox=ae;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/oe,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=this._computeSizeFromTexture(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){if(this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const i=this._context.sharedResources.cimSymbolRasterizer,s=[],o=t,a=o?.symbol;S.fetchResources(a,i.resourceManager,s,r),S.fetchFonts(a,i.resourceManager,s);const n=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],c=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:c,fields:n,geometryType:"esriGeometryPoint"},o?.primitiveOverrides&&s.push(v.createRenderExpressions(o.primitiveOverrides,this._arcadeInfo)),s.length>0&&(await Promise.all(s),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await b(t,this._context.layer.spatialReference,n);this._cimScaleFactorOrFunction=(e,t,i)=>{const s=w(r,e,{$view:i},"esriGeometryPoint",t);return null!==s?s:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||R}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=he(this._getPrimitive())?se:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(he(this._getPrimitive()))return O;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getAnchorPos(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in G?G[e]:G.center}_createMaterialAndAddToStage(e,t){if(this._cimData){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new te(e),this._cimSymbolMaterials.set(e.textureId??0,r),t.add(r)),r}return this._fastUpdates=B(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new te(e),t.add(this._materials[0]),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){for(let t=0;t<3;t++){const r=e.size[t];r&&"symbol-value"!==r&&"proportional"!==r&&(e.size[t]=c(r))}if("symbol-value"===e.size[0])return 1;if(isFinite(+e.size[0]))return+e.size[0]/t;if(isFinite(+e.size[2]))return+e.size[2]/t}return 1}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];if(this._cimData){if(!this._cimData.symbol)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(s,this._context.stage),i=[e.parameters.width,e.parameters.height]}else i=this._size,r=this._materials[0];const s=V(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const o=e.renderingInfo,a=this._getVertexOpacityAndColor(o);let n=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];n=this._getScaleFactor(o,e)}n*=this._symbolTextureRatio;const l=d(i[0]*n,i[1]*n),c=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===c.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,a,l,e.layer.uid):this._createAs3DShape(t,s,r,a,l,c,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=T(le.elevationModeChangeTypes,r,i);if(s!==I.UPDATE)return s;const o=E(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return L.RecreateSymbol;if(!N(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return L.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return L.FastUpdate}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:m}=this._context.sharedResources;if(null==h||null==m)return;const u=this._getIconSize(),d=u*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(m.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=this._computeSizeFromTexture(c,u),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_defaultElevationInfoNoZ(){return me}_createAs3DShape(e,t,r,i,s,o,a){const n=this.getFastUpdateAttrValues(e),l=this._context.layer.uid,c=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:a,layerUid:l}),h=X(r,re,null,i,s,ue,null,n,c),m=H(this._context,t,h,o,a);if(null==m)return null;const u=new D(this,m.object,[h],null,null,j,o);return u.alignedSampledElevation=m.sampledElevation,u.needsElevationUpdates=E(o.mode)||"absolute-height"===o.mode,u.getScreenSize=this._createScreenSizeGetter(s,n),u.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(u.getScreenSize(),1,e),k(u,t,this._context.elevationProvider),u}_createAsOverlay(e,t,r,i,s,o){r.renderPriority=this._renderPriority;const a=_();g(t,a,this._context.overlaySR),a[2]=Q;const n=this._context.clippingExtent;if(null!=n&&!x(n,a))return null;const l=this.getFastUpdateAttrValues(e),c=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),h=X(r,re,a,i,s,null,null,l,c),m=new Y(h,{layerUid:o,graphicUid:e.uid}),u=new U(this,[m],null,this._context.drapeSourceRenderer);return u.getScreenSize=this._createScreenSizeGetter(s,l),u.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(u.getScreenSize(),1,e),u}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=W(de,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=f(e,e,e),r=h(1),i=e*r,s=f(i,i,i);return new $({size:!0,color:!0,rotation:!0,opacity:!1},t,s,r)}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}_computeSizeFromTexture({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}test(){return{...super.test(),material:this._materials[0]}}}function ce(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function he(e){return null!=e&&("cross"===e||"x"===e)}le.PRIMITIVE_SIZE=ne,le.elevationModeChangeTypes={definedChanged:I.UPDATE,staysOnTheGround:I.NONE,onTheGroundChanged:I.RECREATE};const me={mode:"relative-to-ground",offset:0},ue=y(0,0,0,1),de=_();export{le as Graphics3DIconSymbolLayer};
|
|
5
|
+
import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as m}from"../../../../core/string.js";import{dataComponents as u}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as _,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as x}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as b}from"../../../../support/arcadeOnDemand.js";import{CIMSymbolHelper as S}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as v}from"../../../../symbols/cim/OverrideHelper.js";import{evaluateValueOrFunction as P}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as z}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as R}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as w}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as M}from"../../../../symbols/support/utils.js";import C from"../../../2d/arcade/callExpressionWithFeature.js";import{transparentUnit as O}from"./constants.js";import{perObjectElevationAligner as j}from"./ElevationAligners.js";import{SymbolUpdateType as I,elevationModeChangeUpdateType as T,needsElevationUpdates2D as E}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as U}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A}from"./graphicUtils.js";import{ApplyRendererDiffResult as L}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as G}from"./placementUtils.js";import{placePointOnGeometry as V,createStageObject as H,extendPointGraphicElevationContext as k}from"./pointUtils.js";import{initFastSymbolUpdatesState as B,updateFastSymbolUpdatesState as N,evaluateModelTransformScale as W,ConvertOptions as $}from"../support/FastSymbolUpdates.js";import{createTexture as q,requiresHalfTexelOffset as J,defaultSymbolSizeRatio as Z,defaultTexSize as K}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as Q}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as X}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as Y}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as ee}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as te}from"../../webgl-engine/materials/HUDMaterial.js";const re=f(0,0,1),ie=16,se=1.5,oe=Z,ae=[oe/2,oe/2,1-oe/2,1-oe/2],ne=[K*oe,K*oe];class le extends F{getCachedSize(){return{size:this._getIconSize()}}constructor(e,t,r,i){super(e,t,r,i),this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=M(this.symbolLayer),i=u(r);i&&"application/json"===i.mediaType?await this._prepareResourcesCIM(t,JSON.parse(i.data),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):ie);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){let t=this._cimData;if(t&&t.symbol||this.logger.error("Can't create texture, CIM data is undefined"),t.primitiveOverrides){t=s(t);const r=t.primitiveOverrides;v.evaluateOverrides(r,e,this._arcadeInfo.geometryType,null,null),v.applyOverrides(t.symbol,r)}const r=m(JSON.stringify(t));let i=this._cimSymbolTextures.get(r);if(i)return i;const o=this._context.sharedResources.cimSymbolRasterizer,a=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;a&&v.applyDictionaryTextOverrides(t.symbol,e,a,null);const n=null!=this._cimScaleFactorOrFunction?P(this._cimScaleFactorOrFunction,e):1;1!==n&&t.symbol&&z(t.symbol,n,!0);const l=S.getEnvelope(t,null,o.resourceManager);if(l&&l.width&&l.height){const e=l.x+l.width/2,r=l.y+l.height/2,s=o.rasterize({type:"cim",data:t},l.width,l.height,e,r,1,"esriGeometryPoint"),a=new w({x:-l.x/l.width-.5,y:(l.height+l.y)/l.height-.5});this._cimMaterialParametersInfo.anchorPosition=this._getAnchorPos("relative",a),i=new ee(s,{width:s?.width??1,height:s?.height??1})}else i=new ee(new ImageData(1,1),{width:1,height:1});return this._cimSymbolTextures.set(r,i),this._context.stage.add(i),i}_prepareMaterialParameters(){const e={anchorPosition:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},t=this.symbol;if(ce(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(he(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>q(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=J(t),e.distanceFieldBoundingBox=ae;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/oe,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=this._computeSizeFromTexture(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){if(this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const i=this._context.sharedResources.cimSymbolRasterizer,s=[],o=t,a=o?.symbol;S.fetchResources(a,i.resourceManager,s,r),S.fetchFonts(a,i.resourceManager,s);const n=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],c=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:c,fields:n,geometryType:"esriGeometryPoint"},o?.primitiveOverrides&&s.push(v.createRenderExpressions(o.primitiveOverrides,this._arcadeInfo)),s.length>0&&(await Promise.all(s),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await b(t,this._context.layer.spatialReference,n);this._cimScaleFactorOrFunction=(e,t,i)=>{const s=C(r,e,{$view:i},"esriGeometryPoint",t);return null!==s?s:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||R}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=he(this._getPrimitive())?se:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(he(this._getPrimitive()))return O;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getAnchorPos(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in G?G[e]:G.center}_createMaterialAndAddToStage(e,t){if(this._cimData){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new te(e),this._cimSymbolMaterials.set(e.textureId??0,r),t.add(r)),r}return this._fastUpdates=B(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new te(e),t.add(this._materials[0]),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){for(let t=0;t<3;t++){const r=e.size[t];r&&"symbol-value"!==r&&"proportional"!==r&&(e.size[t]=c(r))}if("symbol-value"===e.size[0])return 1;if(isFinite(+e.size[0]))return+e.size[0]/t;if(isFinite(+e.size[2]))return+e.size[2]/t}return 1}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];if(this._cimData){if(!this._cimData.symbol)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(s,this._context.stage);const o=window.devicePixelRatio||1;i=[e.parameters.width/o,e.parameters.height/o]}else i=this._size,r=this._materials[0];const s=V(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const o=e.renderingInfo,a=this._getVertexOpacityAndColor(o);let n=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];n=this._getScaleFactor(o,e)}n*=this._symbolTextureRatio;const l=d(i[0]*n,i[1]*n),c=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===c.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,a,l,e.layer.uid):this._createAs3DShape(t,s,r,a,l,c,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=T(le.elevationModeChangeTypes,r,i);if(s!==I.UPDATE)return s;const o=E(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return L.RecreateSymbol;if(!N(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return L.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return L.FastUpdate}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:m}=this._context.sharedResources;if(null==h||null==m)return;const u=this._getIconSize(),d=u*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(m.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=this._computeSizeFromTexture(c,u),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_defaultElevationInfoNoZ(){return me}_createAs3DShape(e,t,r,i,s,o,a){const n=this.getFastUpdateAttrValues(e),l=this._context.layer.uid,c=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:a,layerUid:l}),h=X(r,re,null,i,s,ue,null,n,c),m=H(this._context,t,h,o,a);if(null==m)return null;const u=new D(this,m.object,[h],null,null,j,o);return u.alignedSampledElevation=m.sampledElevation,u.needsElevationUpdates=E(o.mode)||"absolute-height"===o.mode,u.getScreenSize=this._createScreenSizeGetter(s,n),u.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(u.getScreenSize(),1,e),k(u,t,this._context.elevationProvider),u}_createAsOverlay(e,t,r,i,s,o){r.renderPriority=this._renderPriority;const a=_();g(t,a,this._context.overlaySR),a[2]=Q;const n=this._context.clippingExtent;if(null!=n&&!x(n,a))return null;const l=this.getFastUpdateAttrValues(e),c=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),h=X(r,re,a,i,s,null,null,l,c),m=new Y(h,{layerUid:o,graphicUid:e.uid}),u=new U(this,[m],null,this._context.drapeSourceRenderer);return u.getScreenSize=this._createScreenSizeGetter(s,l),u.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(u.getScreenSize(),1,e),u}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=W(de,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=f(e,e,e),r=h(1),i=e*r,s=f(i,i,i);return new $({size:!0,color:!0,rotation:!0,opacity:!1},t,s,r)}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}_computeSizeFromTexture({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}test(){return{...super.test(),material:this._materials[0]}}}function ce(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function he(e){return null!=e&&("cross"===e||"x"===e)}le.PRIMITIVE_SIZE=ne,le.elevationModeChangeTypes={definedChanged:I.UPDATE,staysOnTheGround:I.NONE,onTheGroundChanged:I.RECREATE};const me={mode:"relative-to-ground",offset:0},ue=y(0,0,0,1),de=_();export{le as Graphics3DIconSymbolLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const n={hide:"hide",hideChildren:"hide-children"},i="root",e=10,t=2;function r({exclusive:n,visible:i,visibilityAppearance:e}){const t="checkbox"===e;return i?n?"circle-f":t?"check-square-f":"view-visible":n?"circle":t?"square":"view-hide"}function l({connectionStatus:n,publishing:i}){return n?"connected"===n?"beacon":"offline":i?"
|
|
5
|
+
const n={hide:"hide",hideChildren:"hide-children"},i="root",e=10,t=2;function r({exclusive:n,visible:i,visibilityAppearance:e}){const t="checkbox"===e;return i?n?"circle-f":t?"check-square-f":"view-visible":n?"circle":t?"square":"view-hide"}function l({connectionStatus:n,publishing:i}){return n?"connected"===n?"beacon":"offline":i?"square":"bullet-point"}function u(i){return!!i&&i.listMode===n.hideChildren}function a(n){if(n)return null!=n.listMode?n.listMode:void 0}function o(n){return null!=n&&"minScale"in n&&null!=n.minScale?n.minScale:void 0}function s(n){return null!=n&&"maxScale"in n&&null!=n.maxScale?n.maxScale:void 0}function c(n){if(!n)return"inherited";const i=S(x(n)?n.layer:n);return null!=i?i?"independent":"inherited":"visibilityMode"in n&&null!=n.visibilityMode?n.visibilityMode:"independent"}function d(n){if(!(!n||"type"in n&&"wmts"===n.type||u(n)))return"sublayers"in n?"sublayers":"layers"in n?"layers":void 0}function y(n){const i=(n?.layer&&x(n.layer)?n.layer.layer:void 0)??n?.layer;return!!i&&(M(i)??!0)}function f(i){return a(i)!==n.hide}function p(n,i){if(!n||null==i||isNaN(i))return!1;const e=o(n),t=s(n),r=null!=e&&!isNaN(e)&&e>0&&i>e,l=null!=t&&!isNaN(t)&&t>0&&i<t;return r||l}function b(n,i){n?.sort(((n,e)=>{const t="uid"in n?i.indexOf(n.uid):-1,r="uid"in e?i.indexOf(e.uid):-1;return t>r?-1:t<r?1:0}))}function h(n,i){const e=n?.layer;if(!e)return;const t=d(e);if(!t)return;let r;"layers"===t&&"layers"in e?r=e.layers:"sublayers"===t&&"sublayers"in e&&(r=e.sublayers),b(r,i)}function v(n){const i=n?.layer;return i&&"layers"in i?i.layers:null}function m(n){const i=x(n)?n:null,e=n?.parent,t=null!=e&&"type"in e&&"map-image"===e.type?i?.source:null,r="";return t&&e?{layer:e,title:r,sublayerIds:[t.mapLayerId]}:{layer:n,title:r}}function x(n){return null!=n&&"layer"in n&&null!=n.layer}function S(n){const i=N(n);return null!=i&&"supportsSublayerVisibility"in i?i.supportsSublayerVisibility:void 0}function M(n){const i=N(n);return null!=i&&"supportsDynamicLayers"in i?i.supportsDynamicLayers:void 0}function N(n){return n&&"capabilities"in n&&null!=n.capabilities&&"exportMap"in n.capabilities?n.capabilities.exportMap:void 0}function g(n){return n?.["data-item"]}function q(n){return n?.getAttribute("data-layer-type")}function w({children:n,error:i,incompatible:e}){return!!n?.filter((n=>!n.hidden)).length&&!i&&!e}export{u as areChildrenHidden,f as canDisplayLayer,y as canSortSublayers,a as findLayerListMode,s as findLayerMaxScale,o as findLayerMinScale,c as findLayerVisibilityMode,g as getItem,v as getItemLayers,q as getLayerType,m as getLegendLayerInfo,d as getNormalizedChildLayerProperty,l as getStatusIcon,r as getVisibilityIcon,p as isLayerOutsideScaleRange,x as isSublayer,w as listItemHasChildren,t as minDragEnabledItems,e as minFilterItems,h as sortChildLayersToIds,b as sortLayersToIds,i as sortableRoot};
|