UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.27 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as o}from"tslib";import{JSONMap as r}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import{toPt as e}from"../core/screenUtils.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import l from"./LineSymbol.js";import n from"./LineSymbolMarker.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";var h;const p=new r({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let d=h=class extends l{constructor(...o){super(...o),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(o,r,t,i,s,l){if(o&&"string"!=typeof o)return o;const n={};return null!=o&&(n.style=o),null!=r&&(n.color=r),null!=t&&(n.width=e(t)),null!=i&&(n.cap=i),null!=s&&(n.join=s),null!=l&&(n.miterLimit=e(l)),n}clone(){return new h({color:t(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()}`}};o([a({esriSLS:"simple-line"},{readOnly:!0})],d.prototype,"type",void 0),o([i({type:p.apiValues,json:{read:p.read,write:p.write}})],d.prototype,"style",void 0),o([i({type:["butt","round","square"],json:{write:{overridePolicy:(o,r,t)=>({enabled:"round"!==o&&null==t?.origin})}}})],d.prototype,"cap",void 0),o([i({type:["miter","round","bevel"],json:{write:{overridePolicy:(o,r,t)=>({enabled:"round"!==o&&null==t?.origin})}}})],d.prototype,"join",void 0),o([i({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":n}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"marker",void 0),o([i({type:Number,json:{read:!1,write:!1}})],d.prototype,"miterLimit",void 0),d=h=o([s("esri.symbols.SimpleLineSymbol")],d);export{d as default};