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.
 
 

10 lines
3.5 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 ../request ../core/JSONSupport ../core/Loadable ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./support/typeUtils".split(" "),function(n,y,k,z,q,B,C,D,A,p){k=class extends k.JSONSupportMixin(z){constructor(d){super(d);this.rulesCategorized={attachment:[],containment:[],connectivity:[]};this.request=y}initialize(){}async load(d){d=this.layer.load(d).then(()=>this._initializeRulesTable());
this.addResolvingPromise(d);return this}getFeatureSQL(d,b){var e=d.layerId.toString(),a=d.fieldsIndex?.normalizeFieldName("assetGroup");d=d.fieldsIndex?.normalizeFieldName("assetType");a=a?b.attributes[a]:null;b=d?b.attributes[d]:null;if(e=this.rulesHash[e])if(e=e.assetGroupHash[a])return e.assetTypeHash[b]||null;return null}async _initializeRulesTable(){const d={};let b;var e=b||={};e[e.from=0]="from";e[e.to=1]="to";e[e.via=2]="via";e=[{networkSourceId:"fromNetworkSource",assetGroupId:"fromAssetGroup",
assetTypeId:"fromAssetType"},{networkSourceId:"toNetworkSource",assetGroupId:"toAssetGroup",assetTypeId:"toAssetType"},{networkSourceId:"viaNetworkSource",assetGroupId:"viaAssetGroup",assetTypeId:"viaAssetType"}];this.rulesCategorized={attachment:[],containment:[],connectivity:[]};for(const f of this.rules)if(f.ruleType===p.RuleType.RTAttachment)this.rulesCategorized.attachment.push(f);else if(f.ruleType===p.RuleType.RTContainment)this.rulesCategorized.containment.push(f);else if(f.ruleType===p.RuleType.RTJunctionJunctionConnectivity)this.rulesCategorized.connectivity.push(f);
else{this.rulesCategorized.connectivity.push(f);var a=[[b.from,b.to],[b.to,b.from]];f.ruleType===p.RuleType.RTEdgeJunctionEdgeConnectivity&&(a=[[b.from,b.via],[b.via,b.from],[b.to,b.via],[b.via,b.to]]);for(const v of a){a=v.shift();var h=v.shift(),g=!1;switch(f.ruleType){case p.RuleType.RTEdgeJunctionEdgeConnectivity:g=a===b.from||a===b.to;break;case p.RuleType.RTJunctionEdgeConnectivity:g=a===b.to}var l=e[a];a=f[l.networkSourceId]?.layerId.toString()??"";const r=f[l.assetGroupId]?.assetGroupCode?.toString();
l=f[l.assetTypeId]?.assetTypeCode?.toString();var m=e[h];h=f[m.networkSourceId]?.layerId.toString()??"";const w=f[m.assetGroupId]?.assetGroupCode?.toString();m=f[m.assetTypeId];const x=m?.assetTypeCode?.toString(),t=d[a]??{assetGroupHash:{}};if(!(r&&l&&w&&x))continue;const u=t.assetGroupHash[r]??{assetTypeHash:{}},c=u.assetTypeHash[l]??{};c[h]=c[h]??{};g&&(c[a]=c[a]??{},g=`(assetgroup = ${r} AND assettype = ${l})`,c[a].anyVertex=c[a].anyVertex?`${c[a].anyVertex}`:`${g}`,"esriNECPEndVertex"===m?.connectivityPolicy&&
(c[a].endVertex=c[a]?.endVertex?`${c[a].endVertex}`:`${g}`));g=`(assetgroup = ${w} AND assettype = ${x})`;c[h].anyVertex=c[h]?.anyVertex?`${c[h].anyVertex} OR ${g}`:`${g}`;"esriNECPEndVertex"===m?.connectivityPolicy&&(c[h].endVertex=c[h]?.endVertex?`${c[h].endVertex} OR ${g}`:`${g}`);u.assetTypeHash[l]=c;t.assetGroupHash[r]=u;d[a]=t}}this.rulesHash=d}};n.__decorate([q.property({constructOnly:!0})],k.prototype,"layer",void 0);n.__decorate([q.property({constructOnly:!0})],k.prototype,"rules",void 0);
n.__decorate([q.property()],k.prototype,"rulesHash",void 0);n.__decorate([q.property()],k.prototype,"rulesCategorized",void 0);n.__decorate([q.property({constructOnly:!0})],k.prototype,"request",void 0);return k=n.__decorate([A.subclass("esri.networks.RulesTable")],k)});