Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
12 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("../../chunks/tslib.es6 ../../geometry ../../PopupTemplate ../../renderers/ClassBreaksRenderer ../../renderers/DictionaryRenderer ../../renderers/DotDensityRenderer ../../renderers/HeatmapRenderer ../../renderers/PieChartRenderer ../../renderers/Renderer ../../renderers/SimpleRenderer ../../renderers/UniqueValueRenderer ../../renderers/support/jsonUtils ../../renderers/support/types ../../core/lang ../../core/MultiOriginJSONSupport ../../core/workers/workers ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../core/accessorSupport/PropertyOrigin ../../geometry/projection ../../geometry/SpatialReference ../../geometry/support/spatialReferenceUtils ../Layer ../graphics/data/FeatureStore ../graphics/data/QueryEngine ../graphics/sources/support/clientSideDefaults ./KnowledgeGraphLayerDataManager ./KnowledgeGraphSublayerBase ../mixins/BlendLayer ../mixins/FeatureEffectLayer ../mixins/FeatureReductionLayer ../mixins/OrderedLayer ../mixins/RefreshableLayer ../mixins/ScaleRangeLayer ../mixins/TemporalLayer ../support/commonProperties ../support/featureReductionUtils ../support/Field ../support/fieldUtils ../support/LabelClass ../support/labelingInfo ../../rest/support/FeatureSet ../../rest/support/Query ../../support/popupUtils ../../core/workers/RemoteClient ../../geometry/Extent ../../geometry/Polygon ../../geometry/Polyline ../../geometry/support/typeUtils".split(" "),
function(d,c,H,ha,ia,ja,ka,la,ma,na,oa,w,I,h,J,pa,e,qa,ra,K,L,M,t,N,u,O,P,Q,v,n,R,x,A,S,B,T,U,C,l,V,y,W,X,Y,Z,p,aa,ba,D,ca,da,m){function k(a){if(!a.json)return a;a.json.write=E(a.json.write);const b=a.json.origins;if(!b)return a;let f;for(f in b){const g=b[f];g&&(g.write=E(g.write))}return a}function E(a){return"object"===typeof a&&a?(!1!==a.enabled&&(a.overridePolicy=ea(a)),a):!0===a?q():a}function ea(a){const {target:b,writer:f,overridePolicy:g,...z}=a;return function(r,fa){r=F.call(this,r,fa);
return r.enabled?{...z,...r}:r}}function q(){return{overridePolicy:F}}function F(a,b){const f=!!this.geometryType;let g={enabled:f};f&&(g={...g,...G.call(this,a,b)});return g}function G(a,b){return{ignoreOrigin:this.originIdOf(b)>M.OriginId.DEFAULTS}}c=class extends R.KnowledgeGraphSublayerBase(S.FeatureReductionLayer(A.FeatureEffectLayer(x.BlendLayer(B.OrderedLayer(C.TemporalLayer(U.ScaleRangeLayer(T.RefreshableLayer(J.MultiOriginJSONMixin(O))))))))){constructor(a){super(a);this.blendMode="normal";
this.capabilities=v.createCapabilities(!1,!1);this.definitionExpression=this.charts=null;this.displayField="";this.graphType=this.featureEffect=this.elevationInfo=this.effect=null;this.labelsVisible=!0;this.layerType=this.labelingInfo=null;this.legendEnabled=!0;this.minScale=this.maxScale=0;this.objectIdField=n.mockOidFieldName;this.objectType=null;this.opacity=1;this.parentCompositeLayer=this.orderBy=null;this.popupEnabled=this.persistenceEnabled=!0;this.popupTemplate=null;this.refreshInterval=0;
this.source={openPorts:()=>this.load().then(()=>{const b=new MessageChannel;new ba(b.port1,{channel:b,client:{queryFeatures:(f,g={})=>{f=p.fromJSON(f);return this.queryFeaturesJSON(f,g)}}});return[b.port2]})};this.title=null;this.type="knowledge-graph-sublayer";this.visible=this.useViewTime=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(a){a=this._normalizeFeatureReduction(a);this._set("featureReduction",a)}get fields(){const a=[];this.objectType?.properties?.forEach(b=>
{a.push(y.fromJSON({name:b.name,type:"esriFieldTypeOID"===b.fieldType?"esriFieldTypeInteger":b.fieldType,alias:b.alias,defaultValue:b.defaultValue,editable:b.editable,nullable:b.nullable}))});a.push(y.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),y.fromJSON({name:n.mockAggregationCountFieldName,type:"esriFieldTypeInteger",alias:n.mockAggregationCountFieldName,editable:!1}));return a}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===
this.graphType?"polyline":"point";const a=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.geometryType;return a&&"esriGeometryNull"!==a?m.featureGeometryTypeKebabDictionary.fromJSON(a):null}get geometryFieldName(){return"link-chart"===this.parentCompositeLayer?.type?n.mockLayoutGeometryFieldName:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const a=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;
return(a?this.objectType?.properties?.[a]:null)?.hasM??!1}get hasZ(){const a=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(a?this.objectType?.properties?.[a]:null)?.hasZ??!1}set renderer(a){W.fixRendererFields(a,this.fieldsIndex);this._set("renderer",a)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):"link-chart"===this.parentCompositeLayer?.type?"relationship"===this.graphType?w.fromJSON(v.createDrawingInfo(m.featureGeometryTypeKebabDictionary.toJSON("polyline")).renderer):
w.fromJSON(v.createDrawingInfo(m.featureGeometryTypeKebabDictionary.toJSON("point")).renderer):w.fromJSON(v.createDrawingInfo(m.featureGeometryTypeKebabDictionary.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??N.WGS84}writeTitle(a,b){b.title=a??"Layer"}createPopupTemplate(a){return aa.createPopupTemplate(this,a)}createQuery(){return new p({where:"1\x3d1",outFields:["*"]})}getField(a){for(let b=
0;b<this.fields.length;b++)if(this.fields[b].name===a)return this.fields[b];return null}getFieldDomain(a,b){return null}async queryFeatures(a,b){const {resolvedQuery:f,queryEngine:g}=await this._setupQueryObjects(a);a=Z.fromJSON(await g.executeQuery(f.toJSON(),b?.signal));a.features.forEach(z=>{z.sourceLayer=this});return a}async queryFeaturesJSON(a,b){const {resolvedQuery:f,queryEngine:g}=await this._setupQueryObjects(a);return await g.executeQuery(f.toJSON(),b?.signal)}async queryFeatureCount(a,
b){const {resolvedQuery:f,queryEngine:g}=await this._setupQueryObjects(a);return g.executeQueryForCount(f.toJSON(),b?.signal)}async queryExtent(a={},b){const {resolvedQuery:f,queryEngine:g}=await this._setupQueryObjects({...a,returnGeometry:!0});a=await g.executeQueryForExtent(f.toJSON(),b?.signal);b=null!=a.extent?.xmin&&null!=a.extent?.xmax&&null!=a.extent?.ymin&&null!=a.extent?.ymax?new D(a.extent):new D;return{count:a.count,extent:b}}async queryObjectIds(a,b){a=p.from(a);if("link-chart"===this.parentCompositeLayer.type&&
this._cachedQueryEngine)var f=this._cachedQueryEngine;else f=await this.parentCompositeLayer.dataManager.getData(a,this,b),f=this.loadQueryEngine(f);return f.executeQueryForIds(a.toJSON(),b?.signal)}loadQueryEngine(a){var b=new P({geometryType:m.featureGeometryTypeKebabDictionary.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ});b=new Q.QueryEngine({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:m.featureGeometryTypeKebabDictionary.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,
objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:b});b.featureStore.addMany(a);return b}async refreshCachedQueryEngine(){const a=await this.parentCompositeLayer.dataManager.getData(new p({where:"1\x3d1",outFields:[n.mockOidFieldName]}),this);this._cachedQueryEngine=this.loadQueryEngine(a)}async _setupQueryObjects(a,b){a=p.from(a);const f=a.geometry;f&&!f.spatialReference?.isWGS84&&(await t.initializeProjection(f.spatialReference,u.wgs84),
a.geometry=f instanceof ca?t.project(f,u.wgs84):f instanceof da?t.project(f,u.wgs84):t.project(f.extent,u.wgs84));"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine?b=this._cachedQueryEngine:(b=await this.parentCompositeLayer.dataManager.getData(a,this,b),b=this.loadQueryEngine(b));return{resolvedQuery:a,queryEngine:b}}};d.__decorate([e.property(k(h.clone(x.blendModeProperty)))],c.prototype,"blendMode",void 0);d.__decorate([e.property()],c.prototype,"capabilities",void 0);d.__decorate([e.property({json:{origins:{"web-scene":{write:!1}},
write:q()}})],c.prototype,"charts",void 0);d.__decorate([e.property({readOnly:!0})],c.prototype,"defaultPopupTemplate",null);d.__decorate([e.property({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],c.prototype,"definitionExpression",void 0);d.__decorate([e.property()],c.prototype,"displayField",void 0);d.__decorate([e.property(k(h.clone(x.effectProperty)))],c.prototype,"effect",void 0);d.__decorate([e.property()],c.prototype,"elevationInfo",
void 0);d.__decorate([e.property(k(h.clone(A.featureEffectProperty)))],c.prototype,"featureEffect",void 0);d.__decorate([e.property(k(h.clone(V.featureReductionProperty)))],c.prototype,"featureReduction",null);d.__decorate([e.property()],c.prototype,"fields",null);d.__decorate([e.property()],c.prototype,"geometryType",null);d.__decorate([e.property()],c.prototype,"geometryFieldName",null);d.__decorate([e.property({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],
c.prototype,"graphType",void 0);d.__decorate([e.property({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],c.prototype,"graphTypeName",null);d.__decorate([e.property()],c.prototype,"hasM",null);d.__decorate([e.property()],c.prototype,"hasZ",null);d.__decorate([e.property({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],c.prototype,"id",void 0);d.__decorate([e.property(k(h.clone(l.labelsVisible)))],c.prototype,"labelsVisible",
void 0);d.__decorate([e.property({type:[X],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Y.reader,write:q()}})],c.prototype,"labelingInfo",void 0);d.__decorate([e.property({readOnly:!0,json:{read:!1,write:{writer(a,b){b.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],c.prototype,"layerType",void 0);d.__decorate([e.property(k(h.clone(l.legendEnabled)))],c.prototype,"legendEnabled",void 0);d.__decorate([e.property(k(h.clone(l.maxScale)))],
c.prototype,"maxScale",void 0);d.__decorate([e.property(k(h.clone(l.minScale)))],c.prototype,"minScale",void 0);d.__decorate([e.property()],c.prototype,"objectIdField",void 0);d.__decorate([e.property()],c.prototype,"objectType",void 0);d.__decorate([e.property(k(h.clone(l.opacity)))],c.prototype,"opacity",void 0);d.__decorate([e.property(k(h.clone(B.orderByProperty)))],c.prototype,"orderBy",void 0);d.__decorate([e.property()],c.prototype,"parentCompositeLayer",void 0);d.__decorate([e.property(k(h.clone(l.popupEnabled)))],
c.prototype,"popupEnabled",void 0);d.__decorate([e.property({type:H,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],c.prototype,"popupTemplate",void 0);d.__decorate([e.property({type:Number,json:{write:{overridePolicy:G}}})],c.prototype,"refreshInterval",void 0);d.__decorate([e.property({types:I.rendererTypes,json:{name:"layerDefinition.drawingInfo.renderer",write:q()}})],c.prototype,"renderer",null);d.__decorate([e.property()],c.prototype,"source",void 0);d.__decorate([e.property()],c.prototype,
"spatialReference",null);d.__decorate([e.property({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],c.prototype,"title",void 0);d.__decorate([L.writer("title")],c.prototype,"writeTitle",null);d.__decorate([e.property({json:{read:!1}})],c.prototype,"type",void 0);d.__decorate([e.property(k(h.clone(C.useViewTimeProperty)))],c.prototype,"useViewTime",void 0);d.__decorate([e.property({type:Boolean,json:{name:"visibility",write:q()}})],c.prototype,"visible",void 0);return c=
d.__decorate([K.subclass("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],c)});