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{clone as o}from"../core/lang.js";import{isSome as e}from"../core/maybe.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{enumeration as i}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{writer as s}from"../core/accessorSupport/decorators/writer.js";import l from"./Font.js";import a from"./Symbol3DLayer.js";import{screenSizeProperty as p}from"./support/materialUtils.js";import{Symbol3DHalo as m}from"./support/Symbol3DHalo.js";import{Symbol3DMaterial as h}from"./support/Symbol3DMaterial.js";import{Symbol3DTextBackground as c}from"./support/Symbol3DTextBackground.js";import{horizontalAlignmentProperty as u,lineHeightProperty as f,verticalAlignmentProperty as y}from"./support/textUtils.js";var g;let d=g=class extends a{constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(t){e(t)&&e(this._userSize)&&(t.size=this._userSize),this._set("font",t)}writeFont(t,o,e,r){const i={...r,textSymbol3D:!0};o.font=t.write({},i),delete o.font.size}get size(){return e(this._userSize)?this._userSize:e(this.font)&&null!=this.font.size?this.font.size:9}set size(t){this._userSize=t,e(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new g({enabled:this.enabled,font:this.font&&o(this.font),halo:this.halo&&o(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:e(this.material)?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:o(this.background)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new g({font:e(t.font)?t.font.clone():new l,halo:z(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new h({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new c({color:t.backgroundColor.clone()}):null})}};function z(t,e){return t&&null!=e&&e>0?new m({color:o(t),size:e}):null}t([r({type:l,json:{write:!0}})],d.prototype,"font",null),t([s("font")],d.prototype,"writeFont",null),t([r({type:m,json:{write:!0}})],d.prototype,"halo",void 0),t([r({...u,json:{default:"center",write:!0}})],d.prototype,"horizontalAlignment",void 0),t([r({...f,json:{default:1,write:!0}})],d.prototype,"lineHeight",void 0),t([r({type:h,json:{write:!0}})],d.prototype,"material",void 0),t([r({type:c,json:{write:!0}})],d.prototype,"background",void 0),t([r(p)],d.prototype,"size",null),t([r({type:String,json:{write:!0}})],d.prototype,"text",void 0),t([i({Text:"text"},{readOnly:!0})],d.prototype,"type",void 0),t([r({...y,json:{default:"baseline",write:!0}})],d.prototype,"verticalAlignment",void 0),d=g=t([n("esri.symbols.TextSymbol3DLayer")],d);const j=d;export{j as default};
|