UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 23.6 kB
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as a}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{applySome as o,isSome as l,destroyMaybe as u,unwrap as h,removeMaybe as d,isNone as c}from"../../../core/maybe.js";import{debounce as p,isAbortError as y}from"../../../core/promiseUtils.js";import{watch as g,whenOnce as f,syncAndInitial as m,initial as _}from"../../../core/reactiveUtils.js";import{property as v}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import R from"../../../layers/effects/FeatureEffectView.js";import S from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as x}from"../../../layers/support/layerUtils.js";import w from"../../../rest/support/AggregateFeatureSet.js";import U from"../../../rest/support/FeatureSet.js";import F from"../../../rest/support/Query.js";import{MAX_FILTERS as C}from"../engine/webgl/definitions.js";import{LayerView2DMixin as q}from"./LayerView2D.js";import{createSchema as I}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as O}from"./features/tileRenderers.js";import{isRendererSupported as E}from"./features/support/rendererUtils.js";import{findSizeVV as T,createClusterCountSizeVariable as V,injectDynamicLevelDependentSizeVisualVariable as j,isClusterCompatibleRenderer as A,createClusterRenderer as N}from"./support/clusterUtils.js";import Q from"./support/FeatureCommandQueue.js";import H from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as L}from"./support/util.js";import{TileManager as k}from"../tiling/TileManager.js";import P from"../../layers/FeatureLayerView.js";import J from"../../layers/LayerView.js";import z from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as M}from"../../webgl/capabilities.js";import B from"../../../geometry/Extent.js";function $(e){return e&&"openPorts"in e}let G=class extends(P(z(q(J)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new Q({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=p((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new R,this._lastDefinitionExpression=null}destroy(){o(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),g((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),m)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new s("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if(("feature"===e.type||"subtype-group"===e.type)&&!x(e)?.operations.supportsQuery)throw new s("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const t=this._createClientOptions();return this._set("_proxy",new H({client:t})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale)?e:null}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,r=this.view.floors,{definitionExpression:i}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:u}=this,h="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,c="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),y=this._effectiveFeatureReduction?.toJSON(),g="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),f="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),m="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:g,sublayerHash:f,subtypeCode:m,filterHash:l(this.filter)&&this.filter.toJSON(),effectHash:l(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:c,gdbVersion:n,definitionExpression:i,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:u,floors:r,clipsHash:p,featureReduction:y,customParameters:h,apiKey:d})}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:i.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const s=t?.filter(l);return s&&s.length?(this._addHighlight(s),{remove:()=>this._removeHighlight(s)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(i);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=U.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=U.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),i=w.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:B.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:r,removed:i}=this._tileStrategy.update(e);(r.length||i.length)&&this._proxy.updateTiles({added:r,removed:i}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new k({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(g((()=>this.renderingConfigHash),(()=>this._update()),_)),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||r||i||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${i}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,{layer:r}=this,i="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,a=!i&&s,o=x(r);if(t&&("feature"===r.type||"subtype-group"===r.type)&&"point"===r.geometryType&&o?.query.supportsPagination&&!o?.operations.supportsEditing&&!a&&has("featurelayer-snapshot-enabled"))try{const e=await r.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),s=this.view.extent,a=h(r.fullExtent),n=a?.clone().intersection(s),o=l(n)?n.width*n.height:0,u=a?.width*a?.height;if(e<=t&&(0===u?0:o/u)>=i)return{mode:"snapshot",featureCount:e}}catch(u){n.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:u})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const t=x(e),{capabilities:r,objectIdField:i}=e,s=e.fields.map((e=>e.toJSON())),n=l(e.fullExtent)?e.fullExtent.toJSON():null,o=L(e.geometryType),u="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,h=e.spatialReference?e.spatialReference.toJSON():null,d="feature"===e.type?e.globalIdField:null;let c;"ogc-feature"===e.type?c=e.source.getSource():$(e.source)?c=await e.source.openPorts():e.parsedUrl&&(c=a(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(c.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,y=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:g,featureCount:f}=await this._detectQueryMode(c);let m=this.layer.objectIdField;if("feature"===this.layer.type&&l(this.layer.orderBy)&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(m=e)}return{type:g,timeReferenceUnknownClient:p,subtypeField:y,featureCount:f,globalIdField:d,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:t,fields:s,fullExtent:n,geometryType:o,objectIdField:i,source:c,timeInfo:u,spatialReference:h,orderByFields:m,datesInUnknownTimezone:p,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=F.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=F.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(n.getLogger(this.declaredClass).error(new s("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:r}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:i}=this._getEffectiveRenderer();this._set("_effectiveRenderer",i);const s=this._createSchemaConfig(),a=this._createConfiguration(s,r,t.filter),o=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){await this._initTileRenderer(l,i);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(i),"stream"!==e.type&&$(e.source)&&(t.source=await e.source.openPorts());const r={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,a,t,r),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(i)}else{"snapshot"===this._serviceOptions.type&&o&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount());const t=await this._proxy.update(a);(t.mesh||t.targets?.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(t)}catch(e){y(e)||n.getLogger(this.declaredClass).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(i),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){y(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(t){y(t),0}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return g((()=>this._aggregateValueRanges),(r=>{this._updateClusterEffectiveRendererSizeVariable(e,t,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const i=T(e.visualVariables);if(l(i)&&"cluster_count"===i.field){const s=e.visualVariables.indexOf(i);e.visualVariables[s]=V(t,r);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const e=r.fields;if("cluster"===r.type){const{renderer:t,didInject:i}=j(r.renderer,r,this._aggregateValueRanges);return i&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,r)),{renderer:t,aggregateFields:e,featureReduction:r}}return{renderer:r.renderer,aggregateFields:e,featureReduction:r}}if(r&&"cluster"===r.type&&t&&A(t)){const e=r,i=[],s=N(i,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:i,featureReduction:r}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,t){const r=await O(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=l(e)?e.timeExtent:null,r=l(this.timeExtent)&&l(t)?this.timeExtent.intersection(t):this.timeExtent||t;let i=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=l(e)?e.where:null;i=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!r&&!s)return l(e)?e.toJSON():null;(e=l(e)&&e.clone()||new S).timeExtent=r,i&&(e.where=i);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let r=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return r;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const i=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));i.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",i.join(", ")),l(r)&&r.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");r=r.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),r=r.replace(e,""),r=r.replace(/\s+/g," ").trim()}r=""!==r?"("+r+") AND "+a:a}return""!==r?r:null}_createConfiguration(e,t,r){const i="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(C),n=this._injectOverrides(t);a[0]=n,a[1]=l(r)?r.toJSON():null;const o=I(e);if(c(o))return null;const u=M("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:i,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:u.supportsTextureFloat,maxTextureSize:u.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||E(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),f((()=>!this._pipelineIsUpdating))}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{y(e)||n.getLogger(this.declaredClass).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{y(e)||n.getLogger(this.declaredClass).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),l(t.geometry)&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([v()],G.prototype,"_serviceOptions",void 0),e([v()],G.prototype,"_proxy",void 0),e([v()],G.prototype,"_pipelineIsUpdating",void 0),e([v()],G.prototype,"_effectiveRenderer",void 0),e([v()],G.prototype,"_effectiveFeatureReduction",null),e([v()],G.prototype,"_aggregateValueRanges",void 0),e([v()],G.prototype,"_commandsQueue",void 0),e([v()],G.prototype,"featureEffectView",void 0),e([v()],G.prototype,"labelsVisible",null),e([v({readOnly:!0})],G.prototype,"queryMode",null),e([v()],G.prototype,"renderingConfigHash",null),e([v()],G.prototype,"tileRenderer",void 0),e([v()],G.prototype,"updating",void 0),G=e([b("esri.views.2d.layers.FeatureLayerView2D")],G);const D=G;export{D as default};