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.
9 lines
2.7 KiB
9 lines
2.7 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/unitUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./ellipsoidUtils ./Point ./Polygon ./SpatialReference ./support/geodesicUtils ./support/webMercatorUtils ./support/WKIDUnitConversion".split(" "),function(h,l,k,g,y,z,r,t,u,m,v,w,q,x){var n;g=n=class extends m{constructor(...a){super(...a);this.center=null;this.geodesic=!1;this.numberOfPoints=60;this.radius=1E3;this.radiusUnit= |
|
"meters"}normalizeCtorArgs(a,e){if(!a?.center){if(a?.rings)return super.normalizeCtorArgs(a,e);a={center:a}}return{...super.normalizeCtorArgs(),...a,...e}}initialize(){var a=this.center;const e=this.numberOfPoints;this.hasZ=a?.hasZ??!1;if(0===this.rings.length&&a){var f=l.convertUnit(this.radius,this.radiusUnit,"meters"),b=a.spatialReference,d="geographic";if(b.isWebMercator)d="webMercator";else if(null!=(b.wkid&&x[b.wkid])||(b.wkt2||b.wkt)&&l.isProjectedWKT(b.wkt2||b.wkt))d="projected";if(this.geodesic){let c; |
|
switch(d){case "webMercator":c=q.webMercatorToGeographic(a);break;case "projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case "geographic":c=a}a=this._createGeodesicCircle(c,f,e);"webMercator"===d&&(a=q.geographicToWebMercator(a))}else{let c;"webMercator"===d||"projected"===d?c=f/l.getMetersPerUnit(a.spatialReference):"geographic"===d&&(c=l.lengthToDegrees(f,"meters",t.getReferenceEllipsoid(a.spatialReference).radius)); |
|
a=this._createPlanarCircle(a,c,e)}this.spatialReference=a.spatialReference;this.addRing(a.rings[0])}}clone(){const {center:a,numberOfPoints:e,radius:f,radiusUnit:b,geodesic:d}=this;return new n({center:a?.clone(),numberOfPoints:e,radius:f,radiusUnit:b,geodesic:d})}_createGeodesicCircle(a,e,f){let b=0;const d=[];for(;360>b;){const c=[0,0];w.directGeodeticSolver(c,[a.x,a.y],b,e,v.WGS84);this.hasZ&&c.push(a.z);d.push(c);b+=360/f}d.push(d[0]);return new m(d)}_createPlanarCircle(a,e,f){const b=[],d=2* |
|
Math.PI/f;for(let p=0;p<f;++p){var c=d*p;c=[a.x+Math.cos(-c)*e,a.y+Math.sin(-c)*e];this.hasZ&&c.push(a.z);b.push(c)}b.push(b[0]);return new m({spatialReference:a.spatialReference,rings:[b]})}};h.__decorate([k.property({type:u})],g.prototype,"center",void 0);h.__decorate([k.property()],g.prototype,"geodesic",void 0);h.__decorate([k.property()],g.prototype,"numberOfPoints",void 0);h.__decorate([k.property()],g.prototype,"radius",void 0);h.__decorate([k.property()],g.prototype,"radiusUnit",void 0);return g= |
|
n=h.__decorate([r.subclass("esri.geometry.Circle")],g)}); |