@vertigis/arcgis-extensions 43.4.1 → 43.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AppConfig.schema.json +4 -0
- package/data/ArcGISServiceTableExtension.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/mapping_BasemapExtension.BasemapExtension.html +4 -1
- package/docs/html/interfaces/mapping_BasemapExtension.BasemapExtensionProperties.html +4 -2
- package/docs/html/variables/version.version.html +1 -1
- package/mapping/BasemapExtension.d.ts +9 -0
- package/mapping/BasemapExtension.js +1 -1
- package/mapping/FeatureLayerExtension.js +1 -1
- package/mapping/SubtypeGroupLayerExtension.js +1 -1
- package/mapping/SubtypeSublayerExtension.js +1 -1
- package/mapping/support/layers.js +1 -1
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/AppConfig.schema.json
CHANGED
|
@@ -185,6 +185,10 @@
|
|
|
185
185
|
"description": "See {@link mapping /BasemapExtension!BasemapExtension.included}.",
|
|
186
186
|
"type": "boolean"
|
|
187
187
|
},
|
|
188
|
+
"isSeries": {
|
|
189
|
+
"description": "See {@link mapping /BasemapExtension!BasemapExtension.isSeries}.",
|
|
190
|
+
"type": "boolean"
|
|
191
|
+
},
|
|
188
192
|
"onClick": {
|
|
189
193
|
"$ref": "#/definitions/Action",
|
|
190
194
|
"description": "See {@link mapping /BasemapExtension!BasemapExtension.onClick}."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import r from"@arcgis/core/rest/support/AttachmentQuery.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{toAttachment as a}from"../data/Attachment.js";import{FeatureSaveError as i}from"../data/FeatureSaveError.js";import{PopupTemplateFeatureSettings as l}from"../mapping/support/PopupTemplateFeatureSettings.js";import{getGlobalIdField as o,isGlobalIdUsed as
|
|
1
|
+
import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import r from"@arcgis/core/rest/support/AttachmentQuery.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{toAttachment as a}from"../data/Attachment.js";import{FeatureSaveError as i}from"../data/FeatureSaveError.js";import{PopupTemplateFeatureSettings as l}from"../mapping/support/PopupTemplateFeatureSettings.js";import{getGlobalIdField as o,getReturnServiceEditsOption as n,isGlobalIdUsed as u}from"../mapping/support/layers.js";import{DefaultArcGISRequestHelper as p}from"../support/ArcGISRequestHelper.js";import{cancelify as c}from"../support/Cancellable.js";import{serializable as d}from"../support/Serializable.js";import{ArcGISRelationshipCollection as h}from"../support/_ArcGISRelationshipCollection.js";import{ReadOnlyCollection as m}from"../utilities/ReadOnlyCollection.js";import{isArcGISServiceTableExtension as b}from"../utilities/extensions.js";import{isFeatureLayer as y,isMapImageSublayer as f,isSubtypeGroupLayer as _}from"../utilities/layers.js";import{isNumeric as w,parse as g}from"../utilities/number.js";import{TableExtension as F,TableSchema as E}from"./_TableExtension.js";import{addAttachment as I,deleteAttachments as j,supportsAttachmentEditing as v}from"./support/attachments.js";let R=class extends F{attachmentTypes;get requestHelper(){return this._requestHelper||(this._requestHelper=new p),this._requestHelper}set requestHelper(e){this._requestHelper=e}get capabilities(){const e=v(this.table);return this.table?.capabilities?.operations?{...this.table.capabilities.operations,supportsAttachmentEditing:e,supportsStandardizedQueries:this.table.capabilities?.query?.supportsStandardizedQueriesOnly}:{...super.capabilities,supportsAttachmentEditing:e}}get canChangeDefinitionExpression(){return!0}_requestHelper;async _getAttachments(e){if(!this.table?.capabilities?.data?.supportsAttachment)return[];const t=+e.primaryKey,s=new r({objectIds:[t]}),i=await this.table.queryAttachments(s);return i?.[t]?.length?i[t].map((e=>a(e,e.url))):[]}async _addAttachment(e,t){return I(e,this.table,t,{attachmentTypes:this.attachmentTypes})}async _deleteAttachments(e,t){return j(e,this.table,t)}get _layerUrl(){return w(this.table.layerId)?`${this.table.url}/${this.table.layerId}`:this.table.url}async*_getFeatures(e,t){const r=this.table.createQuery();r.objectIds=e.map((e=>g(e))),r.where=void 0,r.outFields=t.outFields,r.returnGeometry=t.returnGeometry,yield*(await import("../support/_query.js")).executeQuery(r,this,this.table,t.cancelToken)}async _addFeatures(e,t){const r=Array.from(e);if(0===r.length)return;const s=await this._applyEdits({addFeatures:r.map((e=>e.toGraphic())),updateFeatures:[],deleteFeatures:[]});if(!s.addFeatureResults||s.addFeatureResults.length!==r.length)throw new i("Received malformed response from server while saving feature(s).");let a;if(s.addFeatureResults.forEach(((e,t)=>{const{objectId:s,globalId:l,error:n}=e,u=r[t];if(n){a=a||new i("Errors encountered when adding features.");const{title:r}=u;a.errors.set(`${r}-${t}`,new Error(`Failed to add feature '${r}'. ${e.error.name} : ${e.error.message}`))}else{const{primaryKeyField:e}=u.schema;u.attributes.set(e,s);const t=o(this.table);t&&l&&u.attributes.set(t,l)}})),a)throw a}async _updateFeatures(e,t){const r=Array.from(e);if(0===r.length)return;const s=await this._applyEdits({addFeatures:[],updateFeatures:r.map((e=>e.toGraphic())),deleteFeatures:[]});if(!s.updateFeatureResults||s.updateFeatureResults.length!==r.length)throw new i("Received malformed response from server while saving feature(s).");let a;if(s.updateFeatureResults.forEach(((e,t)=>{if(e.error){a=a||new i("Errors encountered when updating features.");const{primaryKey:s}=r[t];a.errors.set(s,new Error(`Failed to update feature with id ${s}. ${e.error.message}`))}})),a)throw a}async _deleteFeatures(e,t){if(0===e.length)return;const r=await this._applyEdits({addFeatures:[],updateFeatures:[],deleteFeatures:e.map((e=>({objectId:e})))});if(!r.deleteFeatureResults)throw new i("Received malformed response from server while saving feature(s).");let s;if(r.deleteFeatureResults.forEach(((t,r)=>{if(t.error){s=s||new i("Errors encountered when deleting features.");const a=e[r];s.errors.set(a,new Error(`Failed to delete feature with id ${a}. ${t.error.message}`))}})),s)throw s}async _onInitialize(){await super._onInitialize(),await this.relationships.initialize()}_isSupportedTable(e){return!e.loaded||e.isTable}_createFeatureSettings(){return new T(this)}_createRelationships(){return new A(this)}_createSchema(){return new x(this)}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,attachmentTypes:["initial"],table:{...this._toPropertyDef(e.table),default:{}},requestHelper:{serialize:!1}}}async _applyEdits(e,t={}){const r=u(this.table,e),s=this.table.applyEdits(e,{globalIdUsed:r,returnServiceEditsOption:n(this.table)}),a=await c(s,t.cancelToken);if(!a)throw new i("Received malformed response from server while saving feature(s).");return a}};R=e([d],R);export{R as ArcGISServiceTableExtension};class S extends m{constructor(e){if(super(),e.table)this._onTableResolved(e.table);else{this._collection=new t;const r=e.watch("table",(()=>{this._onTableResolved(e.table),r.remove()}),!0)}}_onTableResolved(e){this._collection=new t(e.types)}}let x=class extends E{_typeCollection;constructor(e){super(e),this._typeCollection=new S(e),this._bindSettingToTableProperty("displayField"),this._bindSettingToTableProperty("typeIdField")}get types(){return this._typeCollection}_setSetting(e,t){if(this._tableBindings.has(e))throw new s("This schema property is read-only.");super._setSetting(e,t)}_createFieldCollection(){return new m(super._createFieldCollection())}};x=e([d],x);let T=class extends l{};T=e([d],T);class A extends h{get _sourceUrl(){if(this._source.table?.url)return w(this._source.table.layerId)?`${this._source.table.url}/${this._source.table.layerId}`:this._source.table.url}get _sourceLayerId(){return this._source.table?.layerId}_findRelatedSource(e){if(!this._source.mapExtension||!this._source.table?.url)return;const t=this._source.mapExtension.tableExtensions.initializedItems.find((t=>b(t)&&t.table.url===this._source.table.url&&t.table.layerId===e));if(t)return t;for(const t of this._source.mapExtension.allLayerExtensions.initializedItems.toArray()){const r=t.allSublayerExtensions.initializedItems.find((t=>f(t.sublayer)&&t.sublayer.layer.url===this._source.table.url&&t.sublayer.id===e));if(r)return r}return this._source.mapExtension.allLayerExtensions.initializedItems.find((t=>(y(t.layer)||_(t.layer))&&t.layer.url===this._source.table.url&&t.layer.layerId===e))}}
|