SimpleLineSymbol.js 2.5 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.25/esri/copyright.txt for details.
  4. */
  5. import{_ as r}from"../chunks/tslib.es6.js";import{JSONMap as o}from"../core/jsonMap.js";import{clone as e}from"../core/lang.js";import{toPt as t}from"../core/screenUtils.js";import{property as s}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 l from"./LineSymbol.js";import a from"./LineSymbolMarker.js";var p;const h=new o({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let d=p=class extends l{constructor(...r){super(...r),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(r,o,e,s,i,n){if(r&&"string"!=typeof r)return r;const l={};return null!=r&&(l.style=r),null!=o&&(l.color=o),null!=e&&(l.width=t(e)),null!=s&&(l.cap=s),null!=i&&(l.join=i),null!=n&&(l.miterLimit=t(n)),l}clone(){return new p({color:e(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:this.marker?.clone()})}hash(){return`${super.hash()}.${this.color?.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${this.marker?.hash()}`}};r([i({esriSLS:"simple-line"},{readOnly:!0})],d.prototype,"type",void 0),r([s({type:h.apiValues,json:{read:h.read,write:h.write}})],d.prototype,"style",void 0),r([s({type:["butt","round","square"],json:{write:{overridePolicy:(r,o,e)=>({enabled:"round"!==r&&(null==e||null==e.origin)})}}})],d.prototype,"cap",void 0),r([s({type:["miter","round","bevel"],json:{write:{overridePolicy:(r,o,e)=>({enabled:"round"!==r&&(null==e||null==e.origin)})}}})],d.prototype,"join",void 0),r([s({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":a}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"marker",void 0),r([s({type:Number,json:{read:!1,write:!1}})],d.prototype,"miterLimit",void 0),d=p=r([n("esri.symbols.SimpleLineSymbol")],d);const m=d;export{m as default};