12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as t}from"../chunks/tslib.es6.js";import e from"../TimeExtent.js";import o from"../Viewpoint.js";import r from"../core/Error.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import{JSONSupport as s}from"../core/JSONSupport.js";import{clone as n}from"../core/lang.js";import p from"../core/Logger.js";import{isSome as a,isNone as m}from"../core/maybe.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as l}from"../core/accessorSupport/decorators/cast.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import{ensureType as h}from"../core/accessorSupport/ensureType.js";import{SlideThumbnail as y}from"../webdoc/support/SlideThumbnail.js";var f;let j=f=class extends(i(s)){constructor(t){super(t),this.name=null,this.thumbnail=new y,this.timeExtent=null}castThumbnail(t){return"string"==typeof t?new y({url:t}):h(y,t)}set viewpoint(t){const{targetGeometry:e,scale:o}=t;a(e)&&"point"===e.type&&m(o)&&p.getLogger(this.declaredClass).warn("Bookmark.viewpoint should include 'scale' when its targetGeometry is a point.",t),this._set("viewpoint",t)}readViewpoint(t,e){const{extent:r,viewpoint:i}=e;return o.fromJSON(i||{targetGeometry:r})}writeViewpoint(t,e,o,i){if(!t)return;const{targetGeometry:s}=t;if(a(s)&&"extent"!==s.type){const t="Bookmark.viewpoint cannot be written to JSON when the viewpoint's targetGeometry is not an extent.";i?.messages?i.messages.push(new r("property:unsupported",t)):p.getLogger(this.declaredClass).error(t)}else a(s)&&(e.extent=s.toJSON()),e[o]=t.toJSON()}clone(){return new f(n({name:this.name,thumbnail:this.thumbnail,timeExtent:this.timeExtent,viewpoint:this.viewpoint}))}};t([c({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],j.prototype,"name",void 0),t([c({type:y,json:{write:{overridePolicy:t=>({enabled:!(!t||!t.url)})}}})],j.prototype,"thumbnail",void 0),t([l("thumbnail")],j.prototype,"castThumbnail",null),t([c({type:e,json:{write:!0}})],j.prototype,"timeExtent",void 0),t([c({type:o,nonNullable:!0,json:{write:!0}})],j.prototype,"viewpoint",null),t([u("viewpoint",["extent","viewpoint"])],j.prototype,"readViewpoint",null),t([d("viewpoint")],j.prototype,"writeViewpoint",null),j=f=t([w("esri.webmap.Bookmark")],j);const b=j;export{b as default};
|