12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.24/esri/copyright.txt for details.
- */
- import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{rendererTypes as t,webSceneRendererTypes as i}from"../renderers/support/types.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as p}from"../geometry/support/typeUtils.js";import l from"./Layer.js";import{OGCFeatureSource as a}from"./graphics/sources/OGCFeatureSource.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as m}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as u}from"./mixins/FeatureEffectLayer.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{OrderedLayer as c}from"./mixins/OrderedLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{elevationInfo as I,labelsVisible as b,legendEnabled as x,popupEnabled as S,screenSizePerspectiveEnabled as F,url as R}from"./support/commonProperties.js";import{featureReductionProperty as L}from"./support/featureReductionUtils.js";import O from"./support/FeatureType.js";import T from"./support/Field.js";import{defineFieldProperties as w}from"./support/fieldProperties.js";import{fixRendererFields as D,fixTimeInfoFields as P}from"./support/fieldUtils.js";import E from"./support/LabelClass.js";import{reader as C}from"./support/labelingInfo.js";import U from"../rest/support/Query.js";import{createPopupTemplate as _}from"../support/popupUtils.js";import G from"../geometry/Extent.js";import q from"../geometry/SpatialReference.js";const B=w();let V=class extends(d(m(u(y(c(v(g(f(h(j(o(l)))))))))))){constructor(e){super(e),this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new a({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then((()=>this._fetchService(e)))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}set renderer(e){D(e,this.fieldsIndex),this._set("renderer",e)}on(e,r){return super.on(e,r)}createPopupTemplate(e){return _(this,e)}createQuery(){return new U}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){let t,i=!1;const o=r?.feature?.attributes,s=this.typeIdField&&o?.[this.typeIdField];return null!=s&&this.types&&(i=this.types.some((r=>r.id==s&&(t=r.domains?.[e],"inherited"===t?.type&&(t=this._getLayerDomain(e)),!0)))),i||t||(t=this._getLayerDomain(e)),t}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(U.from(e)||this.createQuery(),r))).then((e=>(e?.features?.forEach((e=>{e.layer=e.sourceLayer=this})),e)))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),D(this.renderer,this.fieldsIndex),P(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const r of this.fields)if(r.name===e&&r.domain)return r.domain;return null}};e([s({readOnly:!0,json:{origins:{service:{read:!0}}}})],V.prototype,"capabilities",void 0),e([s({type:String,json:{write:!0}})],V.prototype,"collectionId",void 0),e([s({type:String})],V.prototype,"copyright",void 0),e([s({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([s({type:String})],V.prototype,"definitionExpression",void 0),e([s({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],V.prototype,"description",void 0),e([s({type:String})],V.prototype,"displayField",void 0),e([s(I)],V.prototype,"elevationInfo",void 0),e([s(L)],V.prototype,"featureReduction",void 0),e([s({type:[T],json:{origins:{service:{name:"layerDefinition.fields"}}}})],V.prototype,"fields",void 0),e([s(B.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([s({readOnly:!0,type:G,json:{origins:{service:{name:"layerDefinition.extent"}}}})],V.prototype,"fullExtent",void 0),e([s({type:p.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:p.read}}}}})],V.prototype,"geometryType",void 0),e([s({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],V.prototype,"hasZ",void 0),e([s({type:Boolean,readOnly:!0})],V.prototype,"isTable",null),e([s({type:[E],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:C},write:!0}}}})],V.prototype,"labelingInfo",void 0),e([s(b)],V.prototype,"labelsVisible",void 0),e([s(x)],V.prototype,"legendEnabled",void 0),e([s({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],V.prototype,"objectIdField",void 0),e([s({type:["OGCFeatureLayer"]})],V.prototype,"operationalLayerType",void 0),e([s(S)],V.prototype,"popupEnabled",void 0),e([s({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([s({types:t,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:i,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],V.prototype,"renderer",null),e([s(F)],V.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],V.prototype,"source",void 0),e([s({readOnly:!0,type:q,json:{origins:{service:{read:!0}}}})],V.prototype,"spatialReference",void 0),e([s({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],V.prototype,"title",void 0),e([s({readOnly:!0,json:{read:!1}})],V.prototype,"type",void 0),e([s({type:String,readOnly:!0})],V.prototype,"typeIdField",void 0),e([s({type:[O]})],V.prototype,"types",void 0),e([s(R)],V.prototype,"url",void 0),V=e([n("esri.layers.OGCFeatureLayer")],V);const M=V;export{M as default};
|