UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.07 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 e}from"../chunks/tslib.es6.js";import o from"../request.js";import r from"../core/Clonable.js";import t from"../core/JSONSupport.js";import{generateUUID as s}from"../core/uuid.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{persistable as a}from"../core/accessorSupport/decorators/persistable.js";import c from"./FocusAreaOutline.js";import l from"../layers/support/PolygonCollection.js";import{f as m}from"../chunks/persistableUrlUtils.js";let u=class extends(t.JSONSupportMixin(r)){constructor(e){super(e),this.id=`focusarea-${s()}`,this.title=null,this.enabled=!0,this.outline=null,this.geometries=new l}readGeometries(e,o,r){Array.isArray(e)?this.geometries=l.fromJSON(e,r):r.hooks?.onAfterLoad?.((()=>this._loadGeometries(m(e,r),r)))}async _loadGeometries(e,r){const t=await o(e,{responseType:"json"});this.geometries=l.fromJSON(t.data,r)}};e([i({type:String,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}}),i()],u.prototype,"id",void 0),e([i({type:String,json:{write:!0}})],u.prototype,"title",void 0),e([i({type:Boolean,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}})],u.prototype,"enabled",void 0),e([i({type:c,json:{write:!0}})],u.prototype,"outline",void 0),e([i({type:l,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}},clonable:e=>new l(e.items.map((e=>e.clone())))}),a({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],u.prototype,"geometries",void 0),e([p(["web-scene","portal-item"],"geometries")],u.prototype,"readGeometries",null),u=e([n("esri.effects.FocusArea")],u);const d=u;export{d as default};