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.
 
 

9 lines
3.1 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 ../../../chunks/tslib.es6 ../../../geometry ../../../core/has ../../../core/Loadable ../../../core/promiseUtils ../../../core/workers/workers ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../rest/support/FeatureSet ../../../geometry/Extent".split(" "),function(c,d,x,h,k,l,m,e,y,z,n,p,q){c.CSVSource=class extends k{constructor(a){super(a);this.type="csv";this.refresh=l.debounce(async b=>
{await this.load();const {extent:g,timeExtent:f}=await this._connection.invoke("refresh",b);g&&(this.sourceJSON.extent=g);f&&(this.sourceJSON.timeInfo.timeExtent=[f.start,f.end]);return{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(a){this.addResolvingPromise(this._startWorker(null!=a?a.signal:null));return Promise.resolve(this)}destroy(){this._connection?.close();this._connection=null}async openPorts(){await this.load();return this._connection.openPorts()}async queryFeatures(a,
b={}){await this.load(b);a=await this._connection.invoke("queryFeatures",a?a.toJSON():null,b);return p.fromJSON(a)}async queryFeaturesJSON(a,b={}){await this.load(b);return this._connection.invoke("queryFeatures",a?a.toJSON():null,b)}async queryFeatureCount(a,b={}){await this.load(b);return this._connection.invoke("queryFeatureCount",a?a.toJSON():null,b)}async queryObjectIds(a,b={}){await this.load(b);return this._connection.invoke("queryObjectIds",a?a.toJSON():null,b)}async queryExtent(a,b={}){await this.load(b);
a=await this._connection.invoke("queryExtent",a?a.toJSON():null,b);return{count:a.count,extent:q.fromJSON(a.extent)}}async querySnapping(a,b={}){await this.load(b);return this._connection.invoke("querySnapping",a,b)}async _startWorker(a){this._connection=await m.open("CSVSourceWorker",{strategy:h("feature-layers-workers")?"dedicated":"local",signal:a,registryTarget:this});const {url:b,delimiter:g,fields:f,latitudeField:r,longitudeField:t,spatialReference:u,timeInfo:v}=this.loadOptions;a=await this._connection.invoke("load",
{url:b,customParameters:this.customParameters,parsingOptions:{delimiter:g,fields:f?.map(w=>w.toJSON()),latitudeField:r,longitudeField:t,spatialReference:u?.toJSON(),timeInfo:v?.toJSON()}},{signal:a});this.locationInfo=a.locationInfo;this.sourceJSON=a.layerDefinition;this.delimiter=a.delimiter}};d.__decorate([e.property()],c.CSVSource.prototype,"type",void 0);d.__decorate([e.property()],c.CSVSource.prototype,"loadOptions",void 0);d.__decorate([e.property()],c.CSVSource.prototype,"customParameters",
void 0);d.__decorate([e.property()],c.CSVSource.prototype,"locationInfo",void 0);d.__decorate([e.property()],c.CSVSource.prototype,"sourceJSON",void 0);d.__decorate([e.property()],c.CSVSource.prototype,"delimiter",void 0);c.CSVSource=d.__decorate([n.subclass("esri.layers.graphics.sources.CSVSource")],c.CSVSource);Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});