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.
 
 

13 lines
5.0 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("exports ../../chunks/tslib.es6 ../../request ../../core/MapUtils ../../core/promiseUtils ../../core/urlUtils ../../core/Version ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/PropertyOrigin ../../geometry/Extent ../../geometry/SpatialReference ../support/arcgisLayerUrl ../support/commonProperties ../../portal/support/portalItemUtils".split(" "),
function(p,f,q,z,r,t,A,h,I,J,K,u,B,v,C,D,w,x,y){p.ArcGISMapService=e=>{e=class extends e{constructor(){super(...arguments);this.capabilities=void 0;this.fullExtent=this.copyright=null;this.legendEnabled=!0;this.spatialReference=null;this.version=void 0;this._allLayersAndTablesMap=null}readCapabilities(a,b){var d=b.capabilities&&b.capabilities.split(",").map(E=>E.toLowerCase().trim());if(!d)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},
exportMap:null,exportTiles:null};var c=this.type;a="tile"!==c&&!!b.supportsDynamicLayers;const g=d.includes("query"),k=d.includes("map"),l=!!b.exportTilesAllowed,m=d.includes("tilemap");d=d.includes("data");const F="tile"!==c&&(!b.tileInfo||a),G="tile"!==c&&(!b.tileInfo||a);c="tile"!==c;var n=b.cimVersion&&A.Version.parse(b.cimVersion);const H=n?.since(1,4)??!1;n=n?.since(2,0)??!1;return{operations:{supportsExportMap:k,supportsExportTiles:l,supportsIdentify:g,supportsQuery:d,supportsTileMap:m},exportMap:k?
{supportsArcadeExpressionForLabeling:H,supportsSublayersChanges:c,supportsDynamicLayers:a,supportsSublayerVisibility:F,supportsSublayerDefinitionExpression:G,supportsCIMSymbols:n}:null,exportTiles:l?{maxExportTilesCount:+b.maxExportTilesCount}:null}}readVersion(a,b){(a=b.currentVersion)||(a=b.hasOwnProperty("capabilities")||b.hasOwnProperty("tables")?10:b.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3);return a}async fetchRelatedService(a){var b=this.portalItem;if(!b||!y.isHostedLayer(b))return null;
this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=b.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},a).then(d=>d.find(c=>"Feature Service"===c.type)??null,()=>null));b=await this._relatedFeatureServicePromise;r.throwIfAborted(a);return b?{itemId:b.id,url:b.url}:null}async fetchSublayerInfo(a,b){const {source:d}=a;if(this?.portalItem&&"tile"===this.type&&"map-layer"===d?.type&&y.isHostedLayer(this.portalItem)&&a.originIdOf("url")<v.OriginId.SERVICE){var c=
await this.fetchRelatedService(b);c&&(a.url=t.join(c.url,d.mapLayerId.toString()),a.layerItemId=c.itemId)}({url:c}=a);let g;if("data-layer"===d.type)g=(await q(c,{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey},...b})).data;else if(c&&a.originIdOf("url")>v.OriginId.SERVICE)try{const k=await this._fetchAllLayersAndTablesFromService(c),l=w.parse(c)?.sublayer??d.mapLayerId;g=k.get(l)}catch{}else{a=a.id;"map-layer"===d?.type&&(a=d.mapLayerId);try{g=(await this.fetchAllLayersAndTables(b)).get(a)}catch{}}return g}async fetchAllLayersAndTables(a){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,
a)}async _fetchAllLayersAndTablesFromService(a,b){await this.load(b);this._allLayersAndTablesMap||(this._allLayersAndTablesMap=new Map);const d=w.parse(a);a=await z.getOrCreateMapValue(this._allLayersAndTablesMap,d?.url.path,()=>q(t.join(d?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(c=>{const g=new Map,{layers:k,tables:l}=c.data;c=[...(k??[]),...(l??[])];for(const m of c)g.set(m.id,m);return{result:g}},c=>({error:c})));r.throwIfAborted(b);
if("result"in a)return a.result;throw a.error;}};f.__decorate([h.property({readOnly:!0})],e.prototype,"capabilities",void 0);f.__decorate([u.reader("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null);f.__decorate([h.property({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0);f.__decorate([h.property({type:C})],e.prototype,"fullExtent",void 0);f.__decorate([h.property(x.id)],
e.prototype,"id",void 0);f.__decorate([h.property({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0);f.__decorate([h.property(x.popupEnabled)],e.prototype,"popupEnabled",void 0);f.__decorate([h.property({type:D})],e.prototype,"spatialReference",void 0);f.__decorate([h.property({readOnly:!0})],e.prototype,"version",void 0);f.__decorate([u.reader("version",["currentVersion","capabilities","tables",
"supportedImageFormatTypes"])],e.prototype,"readVersion",null);return e=f.__decorate([B.subclass("esri.layers.mixins.ArcGISMapService")],e)};Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});