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.
 
 

15 lines
5.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("exports ../../../core/compilerUtils ../../../core/uid ../../../geometry/SpatialReference ../../../geometry/support/zscale ../../../layers/graphics/dehydratedFeatures ../../../layers/graphics/featureConversionUtils ../../../layers/support/Field".split(" "),function(k,n,p,q,r,g,l,t){function u(a,b){return b}function h(a,b,c,d){switch(c){case 0:return e(a,b+d,0);case 1:return"lowerLeft"===a.originPosition?e(a,b+d,1):v(a,b+d,1)}}function m(a,b,c,d){switch(c){case 2:return e(a,b,2);default:return h(a,
b,c,d)}}function w(a,b,c,d){switch(c){case 2:return e(a,b,3);default:return h(a,b,c,d)}}function x(a,b,c,d){switch(c){case 3:return e(a,b,3);default:return m(a,b,c,d)}}function e({translate:a,scale:b},c,d){return a[d]+c*b[d]}function v({translate:a,scale:b},c,d){return a[d]-c*b[d]}class y{constructor(a){this._options=a;this.geometryTypes=["point","multipoint","polyline","polygon"];this._previousCoordinate=[0,0];this._transform=null;this._applyTransform=u;this._lengths=[];this._vertexDimension=this._toAddInCurrentPath=
this._currentLengthIndex=0;this._coordinateBuffer=null;this._coordinateBufferPtr=0;this._attributesConstructor=class{};this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new g.DehydratedFeatureSetClass}finishFeatureResult(a){this._options.applyTransform&&(a.transform=null);this._attributesConstructor=class{};this._coordinateBuffer=null;this._lengths.length=0;if(a.hasZ){var b=r.getGeometryZScaler(a.geometryType,this._options.sourceSpatialReference,
a.spatialReference);if(null!=b)for(const c of a.features)b(c.geometry)}}createSpatialReference(){return new q}addField(a,b){a.fields.push(t.fromJSON(b));const c=a.fields.map(d=>d.name);this._attributesConstructor=function(){for(const d of c)this[d]=null}}addFeature(a,b){g.removeLargeStringAttributes(b.attributes,this._options.maxStringAttributeFields,this._options.maxStringAttributeLength,c=>{const d=b.attributes[a.objectIdFieldName];null!=d&&this._missingAttributes.push({objectId:d,attribute:c})});
a.features.push(b)}addQueryGeometry(a,b){const {queryGeometry:c,queryGeometryType:d}=b;b=l.unquantizeOptimizedGeometry(c.clone(),c,!1,!1,this._transform);b=l.convertToGeometry(b,d,!1,!1);let f=null;switch(d){case "esriGeometryPoint":f="point";break;case "esriGeometryPolygon":f="polygon";break;case "esriGeometryPolyline":f="polyline";break;case "esriGeometryMultipoint":f="multipoint"}b.type=f;a.queryGeometryType=d;a.queryGeometry=b}prepareFeatures(a){this._transform=a.transform??null;this._options.applyTransform&&
a.transform&&(this._applyTransform=this._deriveApplyTransform(a));this._vertexDimension=2;a.hasZ&&this._vertexDimension++;a.hasM&&this._vertexDimension++;switch(a.geometryType){case "point":this.addCoordinate=(b,c,d)=>this.addCoordinatePoint(b,c,d);this.createGeometry=b=>this.createPointGeometry(b);break;case "polygon":this.addCoordinate=(b,c,d)=>this._addCoordinatePolygon(b,c,d);this.createGeometry=b=>this._createPolygonGeometry(b);break;case "polyline":this.addCoordinate=(b,c,d)=>this._addCoordinatePolyline(b,
c,d);this.createGeometry=b=>this._createPolylineGeometry(b);break;case "multipoint":this.addCoordinate=(b,c,d)=>this._addCoordinateMultipoint(b,c,d);this.createGeometry=b=>this._createMultipointGeometry(b);break;case "mesh":case "extent":break;default:n.neverReached(a.geometryType)}}createFeature(){this._currentLengthIndex=this._lengths.length=0;this._previousCoordinate[0]=0;this._previousCoordinate[1]=0;return new g.DehydratedFeatureClass(p.generateUID(),null,new this._attributesConstructor)}allocateCoordinates(){const a=
this._lengths.reduce((b,c)=>b+c,0);this._coordinateBuffer=new Float64Array(a*this._vertexDimension);this._coordinateBufferPtr=0}addLength(a,b){0===this._lengths.length&&(this._toAddInCurrentPath=b);this._lengths.push(b)}createPointGeometry(a){a={type:"point",x:0,y:0,spatialReference:a.spatialReference,hasZ:!!a.hasZ,hasM:!!a.hasM};a.hasZ&&(a.z=0);a.hasM&&(a.m=0);return a}addCoordinatePoint(a,b,c){b=this._transform?this._applyTransform(this._transform,b,c,0):b;if(null!=b)switch(c){case 0:a.x=b;break;
case 1:a.y=b;break;case 2:a.hasZ?a.z=b:a.m=b;break;case 3:a.m=b}}_transformPathLikeValue(a,b){let c=0;1>=b&&(c=this._previousCoordinate[b],this._previousCoordinate[b]+=a);return this._transform?this._applyTransform(this._transform,a,b,c):a}_addCoordinatePolyline(a,b,c){this._dehydratedAddPointsCoordinate(a.paths,b,c)}_addCoordinatePolygon(a,b,c){this._dehydratedAddPointsCoordinate(a.rings,b,c)}_addCoordinateMultipoint(a,b,c){0===c&&a.points.push([]);b=this._transformPathLikeValue(b,c);a.points[a.points.length-
1].push(b)}_createPolygonGeometry(a){return{type:"polygon",rings:[[]],spatialReference:a.spatialReference,hasZ:!!a.hasZ,hasM:!!a.hasM}}_createPolylineGeometry(a){return{type:"polyline",paths:[[]],spatialReference:a.spatialReference,hasZ:!!a.hasZ,hasM:!!a.hasM}}_createMultipointGeometry(a){return{type:"multipoint",points:[],spatialReference:a.spatialReference,hasZ:!!a.hasZ,hasM:!!a.hasM}}_dehydratedAddPointsCoordinate(a,b,c){0===c&&0===this._toAddInCurrentPath--&&(a.push([]),this._toAddInCurrentPath=
this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);b=this._transformPathLikeValue(b,c);a=a[a.length-1];const d=this._coordinateBuffer;d&&(0===c&&a.push(new Float64Array(d.buffer,this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT,this._vertexDimension)),d[this._coordinateBufferPtr++]=b)}_deriveApplyTransform(a){const {hasZ:b,hasM:c}=a;return b&&c?x:b?m:c?w:h}}k.DehydratedFeatureSetParserContext=y;Object.defineProperty(k,Symbol.toStringTag,
{value:"Module"})});