@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 9.4 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7548],{4146(e,t,n){n.d(t,{A:()=>b});var r=n(5482),i=n(11254),l=n(49186),a=n(65529),s=n(4902),o=n(92474),u=n(53966),p=n(74887),c=n(84952),d=n(91429),y=n(5443),g=n(16930),h=n(92602),f=n(79677);let m=0,b=class extends((0,a.Zt)((0,s.s)(o.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+m++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([n.e(812),n.e(7982)]).then(n.bind(n,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await Promise.all([n.e(1218),n.e(812),n.e(5613)]).then(n.bind(n,45613));try{return await r(t)}catch(e){const n=t?.portalItem,r=n?.id||"unset",i=n?.portal?.url||h.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,p.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,c.An)(this.url)}createLayerView(e,t){return Promise.reject(new l.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new l.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,r.Cg)([(0,d.MZ)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],b.prototype,"effectiveVisible",null),(0,r.Cg)([(0,d.MZ)({type:y.A})],b.prototype,"fullExtent",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,r.Cg)([(0,d.MZ)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,d.MZ)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,r.Cg)([(0,d.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,r.Cg)([(0,d.MZ)({clonable:!1})],b.prototype,"parent",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,r.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],b.prototype,"persistenceEnabled",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,r.Cg)([(0,d.MZ)({type:g.A})],b.prototype,"spatialReference",void 0),(0,r.Cg)([(0,d.MZ)({type:String})],b.prototype,"title",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,r.Cg)([(0,d.MZ)()],b.prototype,"url",void 0),(0,r.Cg)([(0,d.MZ)({type:f.A})],b.prototype,"visibilityTimeExtent",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,r.Cg)([(0,d.$K)("esri.layers.Layer")],b)},16215(e,t,n){n.d(t,{S:()=>i,Y:()=>r});const r=Symbol("BasemapInstance");function i(e){return null!=e&&"object"==typeof e&&r in e}},77548(e,t,n){n.d(t,{Gh:()=>w,tk:()=>h,BR:()=>g,p2:()=>d,wI:()=>y,G$:()=>m,$x:()=>f,Ov:()=>o,UC:()=>l,W_:()=>u,OP:()=>b,TU:()=>s,XX:()=>a,jy:()=>p});var r=n(70333),i=n(11254);function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}n(7762),n(84952),n(36563),n(36708),n(4146),new WeakMap,n(16215);const a={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function s(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function o(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function u(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function p(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}function c(e){const t=e?.type;return"binning"===t||"cluster"===t}function d(e,t){if(!p(e))return;const n=t?.graphic,r=e.featureReduction;if(n){if(n.isAggregate){const e=n.origin;return e&&"featureReductionProvider"in e&&r?c(r)?r:null:void 0}return e}return t?.checkFeatureReduction&&r?c(r)?r:null:e}async function y(e,t){const n=r.id?.findServerInfo(e);if(null!=n?.currentVersion)return n.owningSystemUrl||null;const l=e.toLowerCase().indexOf("/rest/services");if(-1===l)return null;const a=`${e.slice(0,l)}/rest/info`,s=null!=t?t.signal:null,{data:o}=await(0,i.A)(a,{query:{f:"json"},responseType:"json",signal:s});return o?.owningSystemUrl||null}function g(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function h(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function f(e,t){return null}function m(e){return null}function b(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function w(e,t){if(!t||!b(e))return;const n=(e.url,null);n&&(e.url=n)}},79677(e,t,n){n.d(t,{A:()=>c});var r,i=n(5482),l=n(25482),a=n(88930),s=n(91429),o=n(98623),u=n(36005),p=n(43937);let c=class extends l.o{static{r=this}static get allTime(){return d}static get empty(){return y}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===r&&n===i}expandTo(e,t=o.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let n=this.start;n&&(n=(0,a.lL)(n,e,t));let i=this.end;if(i){const n=(0,a.lL)(i,e,t);i=i.getTime()===n.getTime()?n:(0,a.S1)(n,1,e,t)}return new r({start:n,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,l=e.end?.getTime()??1/0;let a,s;return i>=t&&i<=n?a=i:t>=i&&t<=l&&(a=t),n>=i&&n<=l?s=n:l>=t&&l<=n&&(s=l),null==a||null==s||isNaN(a)||isNaN(s)?r.empty:new r({start:a===-1/0?null:new Date(a),end:s===1/0?null:new Date(s)})}offset(e,t,n=o.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const i=new r,{start:l,end:s}=this;return null!=l&&(i.start=(0,a.S1)(l,e,t,n)),null!=s&&(i.end=(0,a.S1)(s,e,t,n)),i}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:n})}};(0,i.Cg)([(0,s.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,i.Cg)([(0,u.w)("end")],c.prototype,"readEnd",null),(0,i.Cg)([(0,p.K)("end")],c.prototype,"writeEnd",null),(0,i.Cg)([(0,s.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,i.Cg)([(0,s.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,i.Cg)([(0,s.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,i.Cg)([(0,u.w)("start")],c.prototype,"readStart",null),(0,i.Cg)([(0,p.K)("start")],c.prototype,"writeStart",null),c=r=(0,i.Cg)([(0,s.$K)("esri.time.TimeExtent")],c);const d=new c,y=new c({start:void 0,end:void 0})}}]);