UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.36 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../request.js";import t from"../../core/Collection.js";import e from"../../core/JSONSupport.js";import{urlToObject as s}from"../../core/urlUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import p from"./SceneModification.js";var m;let n=m=class extends(e.JSONSupportMixin(t.ofType(p))){constructor(r){super(r),this.url=null}clone(){return new m({url:this.url,items:this.items.map((r=>r.clone()))})}toJSON(r){return this.toArray().map((o=>o.toJSON(r))).filter((r=>!!r.geometry))}static fromJSON(r,o){const t=new m;for(const e of r)t.add(p.fromJSON(e,o));return t}static async fromUrl(r,t,e){const i={url:s(r),origin:"service"},c=await o(r,{responseType:"json",signal:e?.signal}),n=t.toJSON(),a=[];for(const o of c.data)a.push(p.fromJSON({...o,geometry:{...o.geometry,spatialReference:n}},i));return new m({url:r,items:a})}};r([i({type:String})],n.prototype,"url",void 0),n=m=r([c("esri.layers.support.SceneModifications")],n);export{n as default};