CSVLayer.js 5.1 KB

12345678910111213
  1. // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  2. // See https://js.arcgis.com/4.7/esri/copyright.txt for details.
  3. //>>built
  4. define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/tsSupport/assignHelper ../core/tsSupport/paramHelper ../geometry ../core/urlUtils ../core/accessorSupport/decorators ./FeatureLayer ./graphics/data/FeatureStoreCapabilities ./graphics/sources/CSVSource ../tasks/support/Query".split(" "),function(t,u,m,d,n,f,p,h,c,q,r,k,g){return function(l){function a(e,a){e=l.call(this)||this;e.delimiter=null;e.fields=null;e.latitudeField=null;e.locationType="coordinates";
  5. e.longitudeField=null;e.operationalLayerType="CSV";e.outFields=["*"];e.portalItem=null;e.spatialReference=p.SpatialReference.WGS84;e.source=null;e.type="csv";return e}m(a,l);a.prototype.normalizeCtorArgs=function(a,b){return"string"===typeof a?n({url:a},b):a};Object.defineProperty(a.prototype,"capabilities",{get:function(){return{data:{supportsAttachment:!1,supportsM:!1,supportsZ:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!0,supportsDelete:!0,supportsEditing:!0,
  6. supportsQuery:!0,supportsResizeAttachments:!1,supportsUpdate:!0},query:r.queryCapabilities,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1},editing:{supportsGeometryUpdate:!0,supportsGlobalId:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasService",{get:function(){return!1},
  7. enumerable:!0,configurable:!0});a.prototype.readWebMapLabelsVisible=function(a,b){return null!=b.showLabels?b.showLabels:!!(b.layerDefinition&&b.layerDefinition.drawingInfo&&b.layerDefinition.drawingInfo.labelingInfo)};Object.defineProperty(a.prototype,"url",{set:function(a){this._set("url",a)},enumerable:!0,configurable:!0});a.prototype.readUrl=function(a,b,c){return h.read(a,c)};a.prototype.writeUrl=function(a,b,c,d){a=h.write(a,d);b.url=a?h.normalize(a):a};a.prototype.createGraphicsSource=function(){var a=
  8. this,b=new k.default({delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField,longitudeField:this.longitudeField,spatialReference:this.spatialReference,url:this.url});this._set("source",b);return b.when(function(){a.read({locationInfo:b.locationInfo,columnDelimiter:b.columnDelimiter},{origin:"service",url:a.parsedUrl});return b})};a.prototype.queryFeatures=function(a){var b=this;return this.load().then(function(){return b.source.queryFeatures(a||b.createQuery())}).then(function(a){if(a&&
  9. a.features){var c=b.popupTemplate;a.features.forEach(function(a){a.popupTemplate=c;a.layer=b;a.sourceLayer=b})}return a})};a.prototype.queryObjectIds=function(a){var b=this;return this.load().then(function(){return b.source.queryObjectIds(a||b.createQuery())})};a.prototype.queryFeatureCount=function(a){var b=this;return this.load().then(function(){return b.source.queryFeatureCount(a||b.createQuery())})};a.prototype.queryExtent=function(a){var b=this;return this.load().then(function(){return b.source.queryExtent(a||
  10. b.createQuery())})};a.prototype._verifyFields=function(){};a.prototype._verifySource=function(){};a.prototype._hasMemorySource=function(){return!0};d([c.property({readOnly:!0,dependsOn:["loaded"],json:{read:!1}})],a.prototype,"capabilities",null);d([c.property({type:String,json:{write:{target:"columnDelimiter"},read:{source:"columnDelimiter"}}})],a.prototype,"delimiter",void 0);d([c.property({json:{read:{source:"layerDefinition.fields"}}})],a.prototype,"fields",void 0);d([c.property({readOnly:!0})],
  11. a.prototype,"hasService",null);d([c.reader("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],a.prototype,"readWebMapLabelsVisible",null);d([c.property({type:String,json:{write:{target:"locationInfo.latitudeFieldName"},read:{source:"locationInfo.latitudeFieldName"}}})],a.prototype,"latitudeField",void 0);d([c.property({type:String,json:{write:{target:"locationInfo.locationType"},read:{source:"locationInfo.locationType"}}})],a.prototype,"locationType",void 0);d([c.property({type:String,
  12. json:{write:{target:"locationInfo.longitudeFieldName"},read:{source:"locationInfo.longitudeFieldName"}}})],a.prototype,"longitudeField",void 0);d([c.property()],a.prototype,"operationalLayerType",void 0);d([c.property()],a.prototype,"outFields",void 0);d([c.property({json:{read:!1,write:!1}})],a.prototype,"portalItem",void 0);d([c.property({json:{read:!1},cast:null,type:k.default,readOnly:!0})],a.prototype,"source",void 0);d([c.property({json:{read:!1},value:"csv",readOnly:!0})],a.prototype,"type",
  13. void 0);d([c.property({json:{write:!0}})],a.prototype,"url",null);d([c.reader("url")],a.prototype,"readUrl",null);d([c.writer("url")],a.prototype,"writeUrl",null);d([f(0,c.cast(g))],a.prototype,"queryFeatures",null);d([f(0,c.cast(g))],a.prototype,"queryObjectIds",null);d([f(0,c.cast(g))],a.prototype,"queryFeatureCount",null);d([f(0,c.cast(g))],a.prototype,"queryExtent",null);return a=d([c.subclass("esri.layers.CSVLayer")],a)}(c.declared(q))});