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.
 
 

16 lines
6.5 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 ../../geometry ../../Graphic ../../core/jsonMap ../../core/JSONSupport ../../core/lang ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../geometry/SpatialReference ../../geometry/support/jsonUtils ../../layers/support/Field".split(" "),function(q,B,y,n,C,D,r,H,I,z,E,A,v,u,F){var w;const x=new n.JSONMap({esriGeometryPoint:"point",
esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});n=w=class extends C.JSONSupport{constructor(c){super(c);this.displayFieldName=null;this.exceededTransferLimit=!1;this.features=[];this.geometryType=this.fields=null;this.hasZ=this.hasM=!1;this.spatialReference=this.queryGeometry=null}readFeatures(c,k){k=v.fromJSON(k.spatialReference);const f=[];for(let a=0;a<c.length;a++){var b=c[a];const g=y.fromJSON(b);
var h=b.geometry?.spatialReference;null==g.geometry||h||(g.geometry.spatialReference=k);b=b.aggregateGeometries;h=g.aggregateGeometries;if(b&&null!=h)for(const d in h){const e=h[d],l=b[d]?.spatialReference;null==e||l||(e.spatialReference=k)}f.push(g)}return f}writeGeometryType(c,k,f,b){if(c)x.write(c,k,f,b);else if({features:c}=this,c)for(const h of c)if(null!=h?.geometry){x.write(h.geometry.type,k,f,b);break}}readQueryGeometry(c,k){if(!c)return null;const f=!!c.spatialReference;(c=u.fromJSON(c))&&
!f&&k.spatialReference&&(c.spatialReference=v.fromJSON(k.spatialReference));return c}writeSpatialReference(c,k){if(c)k.spatialReference=c.toJSON();else if({features:c}=this,c)for(const f of c)if(f&&null!=f.geometry&&f.geometry.spatialReference){k.spatialReference=f.geometry.spatialReference.toJSON();break}}clone(){return new w(this.cloneProperties())}cloneProperties(){return D.clone({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,
geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(c){const k=this.write();if(k.features&&Array.isArray(c)&&0<c.length)for(let f=0;f<k.features.length;f++){const b=k.features[f];b.geometry&&(b.geometry=c?.[f]?.toJSON()||b.geometry)}return k}quantize(c){const {scale:[k,f],translate:[b,h]}=c,a=this.features,g=this._getQuantizationFunction(this.geometryType,d=>Math.round((d-b)/k),d=>Math.round((h-
d)/f));for(let d=0,e=a.length;d<e;d++)g?.(a[d].geometry)||(a.splice(d,1),d--,e--);this.transform=c;return this}unquantize(){const {geometryType:c,features:k,transform:f}=this;if(!f)return this;const {translate:[b,h],scale:[a,g]}=f;var d=null;let e=null;if(this.hasZ&&null!=f?.scale?.[2]){const {translate:[,,l],scale:[,,m]}=f;d=p=>p*m+l}if(this.hasM&&null!=f?.scale?.[3]){const {translate:[,,,l],scale:[,,,m]}=f;e=p=>null==p?p:p*m+l}d=this._getHydrationFunction(c,l=>l*a+b,l=>h-l*g,d,e);for(const {geometry:l}of k)null!=
l&&d&&d(l);this.transform=null;return this}_quantizePoints(c,k,f){let b,h;const a=[];for(let d=0,e=c.length;d<e;d++){var g=c[d];if(0<d){const l=k(g[0]);g=f(g[1]);if(l!==b||g!==h)a.push([l-b,g-h]),b=l,h=g}else b=k(g[0]),h=f(g[1]),a.push([b,h])}return 0<a.length?a:null}_getQuantizationFunction(c,k,f){return"point"===c?b=>{b.x=k(b.x);b.y=f(b.y);return b}:"polyline"===c||"polygon"===c?b=>{const h=u.isPolygon(b)?b.rings:b.paths,a=[];for(let g=0,d=h.length;g<d;g++){const e=this._quantizePoints(h[g],k,f);
e&&a.push(e)}return 0<a.length?(u.isPolygon(b)?b.rings=a:b.paths=a,b):null}:"multipoint"===c?b=>{const h=this._quantizePoints(b.points,k,f);return h&&0<h.length?(b.points=h,b):null}:"extent"===c?b=>b:null}_getHydrationFunction(c,k,f,b,h){return"point"===c?a=>{a.x=k(a.x);a.y=f(a.y);b&&(a.z=b(a.z))}:"polyline"===c||"polygon"===c?a=>{a=u.isPolygon(a)?a.rings:a.paths;for(let e=0,l=a.length;e<l;e++){const m=a[e];for(let p=0,G=m.length;p<G;p++){const t=m[p];if(0<p)g+=t[0],d+=t[1];else{var g=t[0];var d=
t[1]}t[0]=k(g);t[1]=f(d)}}if(b&&h)for(let e=0,l=a.length;e<l;e++){g=a[e];for(let m=0,p=g.length;m<p;m++)d=g[m],d[2]=b(d[2]),d[3]=h(d[3])}else if(b)for(let e=0,l=a.length;e<l;e++){g=a[e];for(let m=0,p=g.length;m<p;m++)d=g[m],d[2]=b(d[2])}else if(h)for(let e=0,l=a.length;e<l;e++){g=a[e];for(let m=0,p=g.length;m<p;m++)d=g[m],d[2]=h(d[2])}}:"extent"===c?a=>{a.xmin=k(a.xmin);a.ymin=f(a.ymin);a.xmax=k(a.xmax);a.ymax=f(a.ymax);b&&null!=a.zmax&&null!=a.zmin&&(a.zmax=b(a.zmax),a.zmin=b(a.zmin));h&&null!=a.mmax&&
null!=a.mmin&&(a.mmax=h(a.mmax),a.mmin=h(a.mmin))}:"multipoint"===c?a=>{a=a.points;let g;for(let e=0,l=a.length;e<l;e++){const m=a[e];if(0<e)d+=m[0],g+=m[1];else{var d=m[0];g=m[1]}m[0]=k(d);m[1]=f(g)}if(b&&h)for(let e=0,l=a.length;e<l;e++)d=a[e],d[2]=b(d[2]),d[3]=h(d[3]);else if(b)for(let e=0,l=a.length;e<l;e++)d=a[e],d[2]=b(d[2]);else if(h)for(let e=0,l=a.length;e<l;e++)d=a[e],d[2]=h(d[2])}:null}};q.__decorate([r.property({type:String,json:{write:!0}})],n.prototype,"displayFieldName",void 0);q.__decorate([r.property({type:Boolean,
json:{write:{overridePolicy(c){return{enabled:c}}}}})],n.prototype,"exceededTransferLimit",void 0);q.__decorate([r.property({type:[y],json:{write:!0}})],n.prototype,"features",void 0);q.__decorate([z.reader("features")],n.prototype,"readFeatures",null);q.__decorate([r.property({type:[F],json:{write:!0}})],n.prototype,"fields",void 0);q.__decorate([r.property({type:"point multipoint polyline polygon extent mesh".split(" "),json:{read:{reader:x.read}}})],n.prototype,"geometryType",void 0);q.__decorate([A.writer("geometryType")],
n.prototype,"writeGeometryType",null);q.__decorate([r.property({type:Boolean,json:{write:{overridePolicy(c){return{enabled:c}}}}})],n.prototype,"hasM",void 0);q.__decorate([r.property({type:Boolean,json:{write:{overridePolicy(c){return{enabled:c}}}}})],n.prototype,"hasZ",void 0);q.__decorate([r.property({types:B.geometryTypes,json:{write:!0}})],n.prototype,"queryGeometry",void 0);q.__decorate([z.reader("queryGeometry")],n.prototype,"readQueryGeometry",null);q.__decorate([r.property({type:v,json:{write:!0}})],
n.prototype,"spatialReference",void 0);q.__decorate([A.writer("spatialReference")],n.prototype,"writeSpatialReference",null);q.__decorate([r.property({json:{write:!0}})],n.prototype,"transform",void 0);n=w=q.__decorate([E.subclass("esri.rest.support.FeatureSet")],n);n.prototype.toJSON.isDefaultToJSON=!0;return n});