Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

10 lines
3.2 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("../chunks/tslib.es6 ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/subclass ../core/accessorSupport/decorators/writer ./Extent ./Geometry ./Point ./SpatialReference ./support/extentUtils ./support/zmUtils".split(" "),function(k,n,l,f,x,q,r,t,u,g,v,w,p){var m;f=m=class extends u{constructor(...a){super(...a);this.paths=[];this.type="polyline"}normalizeCtorArgs(a,b){let c=null,e,d,h=null;a&&!Array.isArray(a)?(c=a.paths??
null,b||(a.spatialReference?b=a.spatialReference:a.paths||(b=a)),e=a.hasZ,d=a.hasM):c=a;c=c||[];b=b||v.WGS84;c.length&&null!=c[0]?.[0]&&"number"===typeof c[0][0]&&(c=[c]);if(h=c[0]?.[0])void 0===e&&void 0===d?(e=2<h.length,d=!1):void 0===e?e=!d&&3<h.length:void 0===d&&(d=!e&&3<h.length);return{paths:c,spatialReference:b,hasZ:e,hasM:d}}get cache(){this.commitProperty("paths");this.commitProperty("hasZ");this.commitProperty("hasM");this.commitProperty("spatialReference");return{}}get extent(){const {spatialReference:a}=
this;var b=w.getPolylineExtent(this);if(!b)return null;b=new t(b);b.spatialReference=a;return b}writePaths(a,b){b.paths=n.clone(this.paths)}addPath(a){if(a){var b=this.paths,c=b.length;if(Array.isArray(a[0]))b[c]=a.concat();else{const e=[];for(let d=0,h=a.length;d<h;d++)e[d]=a[d].toArray();b[c]=e}this.notifyChange("paths");return this}}clone(){const a=new m;a.spatialReference=this.spatialReference;a.paths=n.clone(this.paths);a.hasZ=this.hasZ;a.hasM=this.hasM;return a}getPoint(a,b){if(!this._validateInputs(a,
b))return null;a=this.paths[a][b];b=this.hasZ;const c=this.hasM;return b&&!c?new g(a[0],a[1],a[2],void 0,this.spatialReference):c&&!b?new g(a[0],a[1],void 0,a[2],this.spatialReference):b&&c?new g(a[0],a[1],a[2],a[3],this.spatialReference):new g(a[0],a[1],this.spatialReference)}insertPoint(a,b,c){if(!this._validateInputs(a,b,!0))return this;p.updateSupportFromPoint(this,c);Array.isArray(c)||(c=c.toArray());this.paths[a].splice(b,0,c);this.notifyChange("paths");return this}removePath(a){if(!this._validateInputs(a,
null))return null;a=this.paths.splice(a,1)[0];const b=this.spatialReference;a=a.map(c=>new g(c,b));this.notifyChange("paths");return a}removePoint(a,b){if(!this._validateInputs(a,b))return null;a=new g(this.paths[a].splice(b,1)[0],this.spatialReference);this.notifyChange("paths");return a}setPoint(a,b,c){if(!this._validateInputs(a,b))return this;p.updateSupportFromPoint(this,c);Array.isArray(c)||(c=c.toArray());this.paths[a][b]=c;this.notifyChange("paths");return this}_validateInputs(a,b,c=!1){return null==
a||0>a||a>=this.paths.length||null!=b&&(a=this.paths[a],c&&(0>b||b>a.length)||!c&&(0>b||b>=a.length))?!1:!0}toJSON(a){return this.write({},a)}};k.__decorate([l.property({readOnly:!0})],f.prototype,"cache",null);k.__decorate([l.property({readOnly:!0})],f.prototype,"extent",null);k.__decorate([l.property({type:[[[Number]]],json:{write:{isRequired:!0}}})],f.prototype,"paths",void 0);k.__decorate([r.writer("paths")],f.prototype,"writePaths",null);f=m=k.__decorate([q.subclass("esri.geometry.Polyline")],
f);f.prototype.toJSON.isDefaultToJSON=!0;return f});