@vertigis/arcgis-extensions 48.9.2 → 49.0.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 +63 -47
- package/data/Feature.d.ts +4 -4
- package/data/Feature.js +1 -1
- package/data/_TableExtension.d.ts +1 -1
- package/data/support/attachments.js +1 -1
- package/declarations/arcgis-js-api-extensions/index.d.ts +4 -6
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/Entity.EntityBase.html +3 -3
- package/docs/html/classes/data_ArcGISServiceTableExtension.ArcGISServiceTableExtension.html +3 -3
- package/docs/html/classes/data_Attachment.Attachment.html +3 -3
- package/docs/html/classes/data_Feature.Feature.html +5 -5
- package/docs/html/classes/data_FeatureList.FeatureList.html +3 -9
- package/docs/html/classes/data_FeatureSet.FeatureSet.html +0 -1
- package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +3 -3
- package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +3 -9
- package/docs/html/classes/data_FeatureStream.FeatureStream.html +3 -3
- package/docs/html/classes/data_FieldExtension.FieldExtension.html +3 -3
- package/docs/html/classes/data_PopupContentExtension.PopupContentExtension.html +3 -3
- package/docs/html/classes/data_RelationshipBase.RelationshipBase.html +3 -3
- package/docs/html/classes/data__TableExtension.TableExtension.html +3 -3
- package/docs/html/classes/data__TableExtension.TableSchema.html +2 -2
- package/docs/html/classes/layer_preset_LayerPreset.LayerPreset.html +3 -3
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +3 -9
- package/docs/html/classes/mapping_BasemapExtension.BasemapExtension.html +3 -3
- package/docs/html/classes/mapping_Bookmark.Bookmark.html +3 -3
- package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtension.html +3 -3
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_CSVLayerExtension.CSVLayerExtension.html +5 -5
- package/docs/html/classes/mapping_ElevationLayerExtension.ElevationLayerExtension.html +3 -3
- package/docs/html/classes/mapping_FeatureCollectionLayerExtension.FeatureCollectionLayerExtension.html +3 -3
- package/docs/html/classes/mapping_FeatureLayerExtension.FeatureLayerExtension.html +5 -5
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBase.html +3 -3
- package/docs/html/classes/mapping_GeoJSONLayerExtension.GeoJSONLayerExtension.html +5 -5
- package/docs/html/classes/mapping_GeoRSSLayerExtension.GeoRSSLayerExtension.html +3 -3
- package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +3 -3
- package/docs/html/classes/mapping_GroundExtension.GroundExtension.html +3 -3
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +3 -3
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +7 -11
- package/docs/html/classes/mapping_ImageryLayerExtension.ImageryLayerExtension.html +3 -3
- package/docs/html/classes/mapping_ImageryTileLayerExtension.ImageryTileLayerExtension.html +3 -3
- package/docs/html/classes/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtension.html +3 -3
- package/docs/html/classes/mapping_KMLLayerExtension.KMLLayerExtension.html +3 -3
- package/docs/html/classes/mapping_KMLSublayerExtension.KMLSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_MapExtension.MapExtension.html +3 -3
- package/docs/html/classes/mapping_MapImageLayerExtension.MapImageLayerExtension.html +3 -3
- package/docs/html/classes/mapping_MapImageSublayerExtension.MapImageSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +3 -3
- package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtension.html +3 -3
- package/docs/html/classes/mapping_PointCloudLayerExtension.PointCloudLayerExtension.html +3 -3
- package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtension.html +3 -3
- package/docs/html/classes/mapping_SceneLayerExtension.SceneLayerExtension.html +3 -3
- package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerExtension.html +3 -3
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtension.html +3 -3
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +3 -9
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +3 -9
- package/docs/html/classes/mapping_TileLayerExtension.TileLayerExtension.html +3 -3
- package/docs/html/classes/mapping_TileSublayerExtension.TileSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +3 -3
- package/docs/html/classes/mapping_VectorTileLayerExtension.VectorTileLayerExtension.html +3 -3
- package/docs/html/classes/mapping_WFSLayerExtension.WFSLayerExtension.html +3 -3
- package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +3 -3
- package/docs/html/classes/mapping_WMSSublayerExtension.WMSSublayerExtension.html +3 -3
- package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +3 -3
- package/docs/html/classes/mapping_WebTileLayerExtension.WebTileLayerExtension.html +3 -3
- package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +3 -3
- package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +7 -11
- package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +7 -11
- package/docs/html/classes/mapping__SublayerExtension.SublayerExtension.html +3 -3
- package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +3 -9
- package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +7 -11
- package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +7 -11
- package/docs/html/classes/menus_Menu.Menu.html +3 -3
- package/docs/html/classes/menus_MenuItem.MenuItem.html +3 -3
- package/docs/html/classes/support_InitializableBase.InitializableBase.html +3 -3
- package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +3 -9
- package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +3 -9
- package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +3 -9
- package/docs/html/classes/tasks_geocoding_ArcGISGeocoder.ArcGISGeocoder.html +3 -3
- package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +3 -3
- package/docs/html/classes/tasks_identify_ArcGISSublayerQueryIdentifyProvider.ArcGISSublayerQueryIdentifyProvider.html +6 -6
- package/docs/html/classes/tasks_identify_BuildingComponentSublayerClientSideIdentifyProvider.BuildingComponentSublayerClientSideIdentifyProvider.html +6 -6
- package/docs/html/classes/tasks_identify_BuildingComponentSublayerHitTestIdentifyProvider.BuildingComponentSublayerHitTestIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_CSVLayer3DHitTestIdentifyProvider.CSVLayer3DHitTestIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_CSVLayerClientSideQueryIdentifyProvider.CSVLayerClientSideQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_ClientSideIdentifyProvider.ClientSideIdentifyProvider.html +8 -8
- package/docs/html/classes/tasks_identify_FeatureLayer3DHitTestIdentifyProvider.FeatureLayer3DHitTestIdentifyProvider.html +10 -10
- package/docs/html/classes/tasks_identify_FeatureLayerClientSideIdentifyProvider.FeatureLayerClientSideIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_FeatureLayerQueryIdentifyProvider.FeatureLayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_GeoJSONLayer3DHitTestIdentifyProvider.GeoJSONLayer3DHitTestIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_GeoJSONLayerClientSideQueryIdentifyProvider.GeoJSONLayerClientSideQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_GeoRSSLayerIdentifyProvider.GeoRSSLayerIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_GraphicsLayerQueryIdentifyProvider.GraphicsLayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_HitTestIdentifyProvider.HitTestIdentifyProvider.html +10 -10
- package/docs/html/classes/tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html +9 -9
- package/docs/html/classes/tasks_identify_IdentifyService.IdentifyService.html +10 -10
- package/docs/html/classes/tasks_identify_ImageryLayerIdentifyProvider.ImageryLayerIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_KMLLayerQueryIdentifyProvider.KMLLayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_MapNotesSublayerQueryIdentifyProvider.MapNotesSublayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_PointCloudLayerHitTestIdentifyProvider.PointCloudLayerHitTestIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_RouteLayerQueryIdentifyProvider.RouteLayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_SceneLayerClientSideIdentifyProvider.SceneLayerClientSideIdentifyProvider.html +6 -6
- package/docs/html/classes/tasks_identify_SceneLayerHitTestIdentifyProvider.SceneLayerHitTestIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_SceneLayerQueryIdentifyProvider.SceneLayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_StreamLayerClientSideQueryIdentifyProvider.StreamLayerClientSideQueryIdentifyProvider.html +6 -6
- package/docs/html/classes/tasks_identify_SubtypeSublayerClientSideIdentifyProvider.SubtypeSublayerClientSideIdentifyProvider.html +6 -6
- package/docs/html/classes/tasks_identify_SubtypeSublayerQueryIdentifyProvider.SubtypeSublayerQueryIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_WFSLayerClientSideIdentifyProvider.WFSLayerClientSideIdentifyProvider.html +7 -7
- package/docs/html/classes/tasks_identify_WFSLayerQueryIdentifyProvider.WFSLayerQueryIdentifyProvider.html +6 -6
- package/docs/html/classes/tasks_identify_WMSLayerFeatureInfoIdentifyProvider.WMSLayerFeatureInfoIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_identify_WMSSublayerIdentifyProvider.WMSSublayerIdentifyProvider.html +9 -9
- package/docs/html/classes/tasks_query_ArcGISRelationship.ArcGISRelationship.html +3 -3
- package/docs/html/classes/tasks_query_QueryBasedRelationship.QueryBasedRelationship.html +3 -3
- package/docs/html/classes/tasks_query_QueryService.QueryService.html +3 -3
- package/docs/html/classes/tasks_search_SearchService.SearchService.html +3 -3
- package/docs/html/classes/utilities_CaseInsensitiveObservableMap.CaseInsensitiveObservableMap.html +0 -1
- package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +3 -9
- package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +3 -9
- package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +3 -9
- package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +0 -1
- package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +0 -1
- package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +0 -1
- package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +3 -9
- package/docs/html/classes/utilities_ReadOnlyMap.ReadOnlyMap.html +4 -3
- package/docs/html/functions/utilities__geoJson.esriToGeoJSON.html +1 -1
- package/docs/html/functions/utilities__geoJson.geoJSONToEsri.html +2 -2
- package/docs/html/functions/utilities__gml.esriToGml.html +1 -1
- package/docs/html/functions/utilities__gml.gmlToEsri.html +2 -2
- package/docs/html/functions/utilities__project.project.html +4 -4
- package/docs/html/functions/utilities__wkt.esriToWKT.html +1 -1
- package/docs/html/functions/utilities__wkt.wktToEsri.html +2 -2
- package/docs/html/functions/utilities_esri.isGeometry.html +2 -2
- package/docs/html/functions/utilities_geometry.buffer.html +2 -2
- package/docs/html/functions/utilities_geometry.createCrossTypeUnion.html +3 -3
- package/docs/html/functions/utilities_geometry.esriToGeoJSON.html +1 -1
- package/docs/html/functions/utilities_geometry.esriToGml.html +1 -1
- package/docs/html/functions/utilities_geometry.esriToWKT.html +1 -1
- package/docs/html/functions/utilities_geometry.geoJSONToEsri.html +2 -2
- package/docs/html/functions/utilities_geometry.getScreenExtent.html +1 -1
- package/docs/html/functions/utilities_geometry.gmlToEsri.html +2 -2
- package/docs/html/functions/utilities_geometry.project.html +4 -4
- package/docs/html/functions/utilities_geometry.removeZValues.html +3 -3
- package/docs/html/functions/utilities_geometry.wktToEsri.html +2 -2
- package/docs/html/functions/utilities_query.spatialFilter.html +1 -1
- package/docs/html/functions/utilities_symbol.isPointGeometrySymbol.html +2 -2
- package/docs/html/functions/utilities_symbol.isPolygonGeometrySymbol.html +2 -2
- package/docs/html/functions/utilities_symbol.isPolylineGeometrySymbol.html +2 -2
- package/docs/html/functions/utilities_symbol.isSymbol.html +2 -2
- package/docs/html/functions/utilities_symbol.isVolumetric.html +1 -1
- package/docs/html/interfaces/data_Feature.FeatureProperties.html +2 -2
- package/docs/html/interfaces/data_Feature.PresentableAttributes.html +4 -3
- package/docs/html/interfaces/data_support_attachments.AttachmentEnabledLayer.html +8 -4
- package/docs/html/interfaces/json_RendererJson.SizeInfoJson.html +3 -3
- package/docs/html/interfaces/json_SymbolJson.ObjectSymbol3DLayerJson.html +2 -2
- package/docs/html/interfaces/json_WebSceneJson.WebSceneJson.html +2 -2
- package/docs/html/interfaces/support_ArcGISRequestHelper.ArcGISRequestOptions.html +2 -2
- package/docs/html/interfaces/tasks_query_QueryOptions.QueryOptions-1.html +2 -2
- package/docs/html/interfaces/tasks_search_SearchOptions.SearchOptions-1.html +2 -2
- package/docs/html/interfaces/tasks_search_support__querySearchProviderUtils.ExpandSearchAreaResult.html +2 -2
- package/docs/html/interfaces/utilities_transformation.Transformation.html +2 -2
- package/docs/html/modules/support_esri.html +5 -2
- package/docs/html/types/support_esri.FeatureIdentifier.html +1 -0
- package/docs/html/types/support_esri.FeatureLayerApplyEdits.html +1 -1
- package/docs/html/types/support_esri.FeatureLayerApplyEditsEdits.html +1 -0
- package/docs/html/types/support_esri.FeatureLayerApplyEditsOptions.html +1 -0
- package/docs/html/types/support_esri.ItemCallback.html +1 -1
- package/docs/html/types/support_esri.ItemTestCallback.html +1 -1
- package/docs/html/types/support_esri.LengthUnit.html +3 -0
- package/docs/html/types/support_esri.LinearUnits.html +4 -0
- package/docs/html/variables/version.version.html +1 -1
- package/json/GeometryJson.d.ts +1 -1
- package/json/LayerJson.js +1 -1
- package/mapping/CSVLayerExtension.d.ts +2 -2
- package/mapping/FeatureLayerExtension.d.ts +2 -2
- package/mapping/GeoJSONLayerExtension.d.ts +2 -2
- package/mapping/ImageryLayerExtension.js +1 -1
- package/mapping/_SublayerExtension.js +1 -1
- package/mapping/support/featureService.js +1 -1
- package/package.json +2 -2
- package/portal/FeatureLayer.js +1 -1
- package/portal/FeatureReduction.d.ts +1 -1
- package/portal/FeatureReduction.js +1 -1
- package/portal/Lighting.d.ts +1 -1
- package/portal/Symbol.d.ts +2 -1
- package/portal/Widgets.d.ts +1 -1
- package/support/esri.d.ts +21 -6
- package/tasks/identify/BuildingComponentSublayerHitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/CSVLayer3DHitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/CSVLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/ClientSideIdentifyProvider.d.ts +1 -1
- package/tasks/identify/FeatureLayer3DHitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/FeatureLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerClientSideIdentifyProvider.d.ts +3 -3
- package/tasks/identify/FeatureLayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/GeoJSONLayer3DHitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/GeoJSONLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/GeoJSONLayerClientSideQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/GeoRSSLayerIdentifyProvider.d.ts +4 -4
- package/tasks/identify/GraphicsLayerQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/HitTestIdentifyProvider.d.ts +6 -8
- package/tasks/identify/IdentifyProviderBase.d.ts +8 -8
- package/tasks/identify/IdentifyService.d.ts +8 -8
- package/tasks/identify/ImageryLayerIdentifyProvider.d.ts +4 -4
- package/tasks/identify/ImageryLayerIdentifyProvider.js +1 -1
- package/tasks/identify/KMLLayerQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/MapNotesSublayerQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/PointCloudLayerHitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/RouteLayerQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/SceneLayerHitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/SceneLayerQueryIdentifyProvider.d.ts +4 -4
- package/tasks/identify/StreamLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/SubtypeSublayerQueryIdentifyProvider.d.ts +5 -5
- package/tasks/identify/WMSLayerFeatureInfoIdentifyProvider.d.ts +4 -4
- package/tasks/identify/WMSSublayerIdentifyProvider.d.ts +4 -4
- package/tasks/identify/_utilities.js +1 -1
- package/tasks/query/QueryOptions.d.ts +3 -3
- package/tasks/query/StreamLayerClientSideQueryProvider.js +1 -1
- package/tasks/search/QuerySearchProvider.js +1 -1
- package/tasks/search/SearchOptions.d.ts +3 -3
- package/tasks/search/SubtypeSublayerQuerySearchProvider.js +1 -1
- package/tasks/search/support/_querySearchProviderUtils.d.ts +2 -2
- package/utilities/CollectionProxy.d.ts +9 -9
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/CopyOnWriteCollection.d.ts +2 -2
- package/utilities/_geoJson.d.ts +3 -3
- package/utilities/_gml.d.ts +3 -3
- package/utilities/_project.d.ts +2 -2
- package/utilities/_wkt.d.ts +3 -3
- package/utilities/basemaps.js +1 -1
- package/utilities/esri.d.ts +2 -2
- package/utilities/geometry.d.ts +13 -14
- package/utilities/geometry.js +1 -1
- package/utilities/query.d.ts +2 -2
- package/utilities/query.js +1 -1
- package/utilities/symbol.d.ts +3 -3
- package/utilities/watch.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/docs/html/types/support_esri.FeatureLayerBaseApplyEditsEdits.html +0 -1
- package/docs/html/types/support_esri.FeatureLayerBaseApplyEditsOptions.html +0 -1
package/AppConfig.schema.json
CHANGED
|
@@ -501,7 +501,22 @@
|
|
|
501
501
|
"geometry": {
|
|
502
502
|
"anyOf": [
|
|
503
503
|
{
|
|
504
|
-
"$ref": "#/definitions/esri.
|
|
504
|
+
"$ref": "#/definitions/esri.Extent"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"$ref": "#/definitions/esri.Multipoint"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"$ref": "#/definitions/esri.Point"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"$ref": "#/definitions/esri.Polygon"
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"$ref": "#/definitions/esri.Polyline"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"$ref": "#/definitions/esri.Mesh"
|
|
505
520
|
},
|
|
506
521
|
{
|
|
507
522
|
"$ref": "#/definitions/PointJson"
|
|
@@ -3189,16 +3204,20 @@
|
|
|
3189
3204
|
"esri.FeatureLayer": {},
|
|
3190
3205
|
"esri.FeatureType": {},
|
|
3191
3206
|
"esri.Field": {},
|
|
3192
|
-
"esri.Geometry": {},
|
|
3193
3207
|
"esri.Layer": {},
|
|
3194
3208
|
"esri.Map": {},
|
|
3209
|
+
"esri.Mesh": {},
|
|
3210
|
+
"esri.Multipoint": {},
|
|
3211
|
+
"esri.Point": {},
|
|
3212
|
+
"esri.Polygon": {},
|
|
3213
|
+
"esri.Polyline": {},
|
|
3195
3214
|
"esri.Popup": {},
|
|
3196
3215
|
"esri.PopupTemplate": {},
|
|
3197
3216
|
"esri.Portal": {},
|
|
3198
3217
|
"esri.PortalItem": {
|
|
3199
3218
|
"properties": {
|
|
3200
3219
|
"access": {
|
|
3201
|
-
"description": "Indicates the level of access to this item: `private`, `shared`, `org`, or `public`.\n\n
|
|
3220
|
+
"description": "Indicates the level of access to this item: `private`, `shared`, `org`, or `public`.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access Read more...}",
|
|
3202
3221
|
"enum": [
|
|
3203
3222
|
"org",
|
|
3204
3223
|
"private",
|
|
@@ -3208,26 +3227,26 @@
|
|
|
3208
3227
|
"type": "string"
|
|
3209
3228
|
},
|
|
3210
3229
|
"accessInformation": {
|
|
3211
|
-
"description": "Information on the source of the item and its copyright status.\n\n
|
|
3230
|
+
"description": "Information on the source of the item and its copyright status.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation Read more...}",
|
|
3212
3231
|
"type": "string"
|
|
3213
3232
|
},
|
|
3214
3233
|
"apiKey": {
|
|
3215
|
-
"description": "An authorization string used to access the portal item.\n\n
|
|
3234
|
+
"description": "An authorization string used to access the portal item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#apiKey Read more...}",
|
|
3216
3235
|
"type": "string"
|
|
3217
3236
|
},
|
|
3218
3237
|
"applicationProxies": {
|
|
3219
|
-
"description": "Contains an array of objects containing proxy information for premium platform services.\n\n
|
|
3238
|
+
"description": "Contains an array of objects containing proxy information for premium platform services.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies Read more...}",
|
|
3220
3239
|
"items": {
|
|
3221
3240
|
"$ref": "#/definitions/esri.PortalItemApplicationProxies"
|
|
3222
3241
|
},
|
|
3223
3242
|
"type": "array"
|
|
3224
3243
|
},
|
|
3225
3244
|
"avgRating": {
|
|
3226
|
-
"description": "Average rating.\n\n
|
|
3245
|
+
"description": "Average rating.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating Read more...}",
|
|
3227
3246
|
"type": "number"
|
|
3228
3247
|
},
|
|
3229
3248
|
"categories": {
|
|
3230
|
-
"description": "An array of organization categories that are set on the item.\n\n
|
|
3249
|
+
"description": "An array of organization categories that are set on the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories Read more...}",
|
|
3231
3250
|
"items": {
|
|
3232
3251
|
"type": "string"
|
|
3233
3252
|
},
|
|
@@ -3235,22 +3254,22 @@
|
|
|
3235
3254
|
},
|
|
3236
3255
|
"classification": {
|
|
3237
3256
|
"$ref": "#/definitions/__type",
|
|
3238
|
-
"description": "The classification information for the item.\n\n
|
|
3257
|
+
"description": "The classification information for the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#classification Read more...}"
|
|
3239
3258
|
},
|
|
3240
3259
|
"created": {
|
|
3241
|
-
"description": "The date the item was created.\n\n
|
|
3260
|
+
"description": "The date the item was created.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created Read more...}",
|
|
3242
3261
|
"format": "date-time",
|
|
3243
3262
|
"type": "string"
|
|
3244
3263
|
},
|
|
3245
3264
|
"culture": {
|
|
3246
|
-
"description": "The item's locale information (language and country).\n\n
|
|
3265
|
+
"description": "The item's locale information (language and country).\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture Read more...}",
|
|
3247
3266
|
"type": "string"
|
|
3248
3267
|
},
|
|
3249
3268
|
"declaredClass": {
|
|
3250
3269
|
"type": "string"
|
|
3251
3270
|
},
|
|
3252
3271
|
"description": {
|
|
3253
|
-
"description": "The detailed description of the item.\n\n
|
|
3272
|
+
"description": "The detailed description of the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description Read more...}",
|
|
3254
3273
|
"type": "string"
|
|
3255
3274
|
},
|
|
3256
3275
|
"destroyed": {
|
|
@@ -3258,32 +3277,32 @@
|
|
|
3258
3277
|
},
|
|
3259
3278
|
"extent": {
|
|
3260
3279
|
"$ref": "#/definitions/esri.Extent",
|
|
3261
|
-
"description": "The geographic extent, or bounding rectangle, of the item.\n\n
|
|
3280
|
+
"description": "The geographic extent, or bounding rectangle, of the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent Read more...}"
|
|
3262
3281
|
},
|
|
3263
3282
|
"groupCategories": {
|
|
3264
|
-
"description": "An array of group categories set on the item.\n\n
|
|
3283
|
+
"description": "An array of group categories set on the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories Read more...}",
|
|
3265
3284
|
"items": {
|
|
3266
3285
|
"type": "string"
|
|
3267
3286
|
},
|
|
3268
3287
|
"type": "array"
|
|
3269
3288
|
},
|
|
3270
3289
|
"id": {
|
|
3271
|
-
"description": "The unique id for the item.\n\n
|
|
3290
|
+
"description": "The unique id for the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id Read more...}",
|
|
3272
3291
|
"type": "string"
|
|
3273
3292
|
},
|
|
3274
3293
|
"initialized": {
|
|
3275
3294
|
"type": "boolean"
|
|
3276
3295
|
},
|
|
3277
3296
|
"isLayer": {
|
|
3278
|
-
"description": "Indicates whether a layer can be created from this item using [Layer.fromPortalItem()](esri-layers-Layer.html#fromPortalItem).\n\n
|
|
3297
|
+
"description": "Indicates whether a layer can be created from this item using [Layer.fromPortalItem()](esri-layers-Layer.html#fromPortalItem).\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer Read more...}",
|
|
3279
3298
|
"type": "boolean"
|
|
3280
3299
|
},
|
|
3281
3300
|
"isOrgItem": {
|
|
3282
|
-
"description": "Indicates whether this item and the user whose credential was used to fetch this item belong
|
|
3301
|
+
"description": "Indicates whether this item and the user whose credential was used to fetch this item belong\nto the same ArcGIS Enterprise Portal or ArcGIS Online Organization.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isOrgItem Read more...}",
|
|
3283
3302
|
"type": "boolean"
|
|
3284
3303
|
},
|
|
3285
3304
|
"itemControl": {
|
|
3286
|
-
"description": "Indicates whether an item can be updated and deleted.\n\n
|
|
3305
|
+
"description": "Indicates whether an item can be updated and deleted.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemControl Read more...}",
|
|
3287
3306
|
"enum": [
|
|
3288
3307
|
"admin",
|
|
3289
3308
|
"null",
|
|
@@ -3292,25 +3311,25 @@
|
|
|
3292
3311
|
"type": "string"
|
|
3293
3312
|
},
|
|
3294
3313
|
"itemPageUrl": {
|
|
3295
|
-
"description": "The URL to the [Item page](https://doc.arcgis.com/en/arcgis-online/manage-data/item-details.htm) on the portal.\n\n
|
|
3314
|
+
"description": "The URL to the [Item page](https://doc.arcgis.com/en/arcgis-online/manage-data/item-details.htm) on the portal.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemPageUrl Read more...}",
|
|
3296
3315
|
"type": "string"
|
|
3297
3316
|
},
|
|
3298
3317
|
"itemUrl": {
|
|
3299
|
-
"description": "The URL to the item.\n\n
|
|
3318
|
+
"description": "The URL to the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemUrl Read more...}",
|
|
3300
3319
|
"type": "string"
|
|
3301
3320
|
},
|
|
3302
3321
|
"licenseInfo": {
|
|
3303
|
-
"description": "Information on license or restrictions related to the item.\n\n
|
|
3322
|
+
"description": "Information on license or restrictions related to the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo Read more...}",
|
|
3304
3323
|
"type": "string"
|
|
3305
3324
|
},
|
|
3306
3325
|
"loadError": {
|
|
3307
3326
|
"$ref": "#/definitions/esri.Error",
|
|
3308
|
-
"default": "null\n\n
|
|
3327
|
+
"default": "null\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loadError Read more...}",
|
|
3309
3328
|
"description": "The Error object returned if an error occurred while loading."
|
|
3310
3329
|
},
|
|
3311
3330
|
"loadStatus": {
|
|
3312
|
-
"default": "\"not-loaded\"\n\n
|
|
3313
|
-
"description": "Represents the status of a
|
|
3331
|
+
"default": "\"not-loaded\"\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loadStatus Read more...}",
|
|
3332
|
+
"description": "Represents the status of a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#load load} operation.",
|
|
3314
3333
|
"enum": [
|
|
3315
3334
|
"failed",
|
|
3316
3335
|
"loaded",
|
|
@@ -3320,50 +3339,50 @@
|
|
|
3320
3339
|
"type": "string"
|
|
3321
3340
|
},
|
|
3322
3341
|
"loadWarnings": {
|
|
3323
|
-
"description": "A list of warnings which occurred while loading.\n\n
|
|
3342
|
+
"description": "A list of warnings which occurred while loading.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loadWarnings Read more...}",
|
|
3324
3343
|
"items": {},
|
|
3325
3344
|
"type": "array"
|
|
3326
3345
|
},
|
|
3327
3346
|
"loaded": {
|
|
3328
|
-
"default": "false\n\n
|
|
3347
|
+
"default": "false\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loaded Read more...}",
|
|
3329
3348
|
"description": "Indicates whether the item's resources have loaded from the portal.",
|
|
3330
3349
|
"type": "boolean"
|
|
3331
3350
|
},
|
|
3332
3351
|
"modified": {
|
|
3333
|
-
"description": "The date the item was last modified.\n\n
|
|
3352
|
+
"description": "The date the item was last modified.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified Read more...}",
|
|
3334
3353
|
"format": "date-time",
|
|
3335
3354
|
"type": "string"
|
|
3336
3355
|
},
|
|
3337
3356
|
"name": {
|
|
3338
|
-
"description": "The name of the item.\n\n
|
|
3357
|
+
"description": "The name of the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name Read more...}",
|
|
3339
3358
|
"type": "string"
|
|
3340
3359
|
},
|
|
3341
3360
|
"numComments": {
|
|
3342
|
-
"description": "Number of comments on the item.\n\n
|
|
3361
|
+
"description": "Number of comments on the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments Read more...}",
|
|
3343
3362
|
"type": "number"
|
|
3344
3363
|
},
|
|
3345
3364
|
"numRatings": {
|
|
3346
|
-
"description": "Number of ratings on the item.\n\n
|
|
3365
|
+
"description": "Number of ratings on the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings Read more...}",
|
|
3347
3366
|
"type": "number"
|
|
3348
3367
|
},
|
|
3349
3368
|
"numViews": {
|
|
3350
|
-
"description": "Number of views on the item.\n\n
|
|
3369
|
+
"description": "Number of views on the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews Read more...}",
|
|
3351
3370
|
"type": "number"
|
|
3352
3371
|
},
|
|
3353
3372
|
"owner": {
|
|
3354
|
-
"description": "The username of the user who owns this item.\n\n
|
|
3373
|
+
"description": "The username of the user who owns this item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner Read more...}",
|
|
3355
3374
|
"type": "string"
|
|
3356
3375
|
},
|
|
3357
3376
|
"ownerFolder": {
|
|
3358
|
-
"description": "The ID of the folder in which the owner has stored the item.\n\n
|
|
3377
|
+
"description": "The ID of the folder in which the owner has stored the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#ownerFolder Read more...}",
|
|
3359
3378
|
"type": "string"
|
|
3360
3379
|
},
|
|
3361
3380
|
"portal": {
|
|
3362
3381
|
"$ref": "#/definitions/esri.Portal",
|
|
3363
|
-
"description": "The portal that contains the item.\n\n
|
|
3382
|
+
"description": "The portal that contains the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal Read more...}"
|
|
3364
3383
|
},
|
|
3365
3384
|
"screenshots": {
|
|
3366
|
-
"default": "null\n\n
|
|
3385
|
+
"default": "null\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots Read more...}",
|
|
3367
3386
|
"description": "An array of string URLs.",
|
|
3368
3387
|
"items": {
|
|
3369
3388
|
"type": "string"
|
|
@@ -3371,44 +3390,44 @@
|
|
|
3371
3390
|
"type": "array"
|
|
3372
3391
|
},
|
|
3373
3392
|
"size": {
|
|
3374
|
-
"description": "The size of the item (in bytes).\n\n
|
|
3393
|
+
"description": "The size of the item (in bytes).\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size Read more...}",
|
|
3375
3394
|
"type": "number"
|
|
3376
3395
|
},
|
|
3377
3396
|
"snippet": {
|
|
3378
|
-
"description": "A summary description of the item.\n\n
|
|
3397
|
+
"description": "A summary description of the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet Read more...}",
|
|
3379
3398
|
"type": "string"
|
|
3380
3399
|
},
|
|
3381
3400
|
"sourceJSON": {
|
|
3382
|
-
"description": "The JSON used to create the property values when the `PortalItem` is loaded.\n\n
|
|
3401
|
+
"description": "The JSON used to create the property values when the `PortalItem` is loaded.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#sourceJSON Read more...}"
|
|
3383
3402
|
},
|
|
3384
3403
|
"tags": {
|
|
3385
|
-
"description": "User defined tags that describe the item.\n\n
|
|
3404
|
+
"description": "User defined tags that describe the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags Read more...}",
|
|
3386
3405
|
"items": {
|
|
3387
3406
|
"type": "string"
|
|
3388
3407
|
},
|
|
3389
3408
|
"type": "array"
|
|
3390
3409
|
},
|
|
3391
3410
|
"thumbnailUrl": {
|
|
3392
|
-
"description": "The URL to the thumbnail used for the item.\n\n
|
|
3411
|
+
"description": "The URL to the thumbnail used for the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#thumbnailUrl Read more...}",
|
|
3393
3412
|
"type": "string"
|
|
3394
3413
|
},
|
|
3395
3414
|
"title": {
|
|
3396
|
-
"description": "The title for the item.\n\n
|
|
3415
|
+
"description": "The title for the item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title Read more...}",
|
|
3397
3416
|
"type": "string"
|
|
3398
3417
|
},
|
|
3399
3418
|
"type": {
|
|
3400
|
-
"description": "The GIS content type of this item.\n\n
|
|
3419
|
+
"description": "The GIS content type of this item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type Read more...}",
|
|
3401
3420
|
"type": "string"
|
|
3402
3421
|
},
|
|
3403
3422
|
"typeKeywords": {
|
|
3404
|
-
"description": "Type keywords that describe the type of content of this item.\n\n
|
|
3423
|
+
"description": "Type keywords that describe the type of content of this item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords Read more...}",
|
|
3405
3424
|
"items": {
|
|
3406
3425
|
"type": "string"
|
|
3407
3426
|
},
|
|
3408
3427
|
"type": "array"
|
|
3409
3428
|
},
|
|
3410
3429
|
"url": {
|
|
3411
|
-
"description": "The service URL of this item.\n\n
|
|
3430
|
+
"description": "The service URL of this item.\n\n{@link https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url Read more...}",
|
|
3412
3431
|
"type": "string"
|
|
3413
3432
|
}
|
|
3414
3433
|
},
|
|
@@ -3463,15 +3482,12 @@
|
|
|
3463
3482
|
"esri.PortalItemApplicationProxies": {
|
|
3464
3483
|
"properties": {
|
|
3465
3484
|
"proxyId": {
|
|
3466
|
-
"description": "The proxy ID registered in ArcGIS Online or ArcGIS Enterprise Portal.\n\n[Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies)",
|
|
3467
3485
|
"type": "string"
|
|
3468
3486
|
},
|
|
3469
3487
|
"proxyUrl": {
|
|
3470
|
-
"description": "The proxy URL for the source URL.\n\n[Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies)",
|
|
3471
3488
|
"type": "string"
|
|
3472
3489
|
},
|
|
3473
3490
|
"sourceUrl": {
|
|
3474
|
-
"description": "The URL of the premium map service layer.\n\n[Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies)",
|
|
3475
3491
|
"type": "string"
|
|
3476
3492
|
}
|
|
3477
3493
|
},
|
package/data/Feature.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Graphic from "@arcgis/core/Graphic";
|
|
2
2
|
import Collection from "@arcgis/core/core/Collection";
|
|
3
|
-
import type Geometry from "@arcgis/core/geometry/Geometry";
|
|
4
3
|
import type FeatureType from "@arcgis/core/layers/support/FeatureType";
|
|
4
|
+
import type { GeometryUnion } from "@arcgis/core/unionTypes.js";
|
|
5
5
|
import type { EntityBaseProperties } from "../Entity.js";
|
|
6
6
|
import { EntityBase } from "../Entity.js";
|
|
7
7
|
import { Hyperlink } from "../Hyperlink.js";
|
|
@@ -38,7 +38,7 @@ export interface FeatureProperties extends EntityBaseProperties {
|
|
|
38
38
|
/**
|
|
39
39
|
* The feature's geometry.
|
|
40
40
|
*/
|
|
41
|
-
geometry?:
|
|
41
|
+
geometry?: GeometryUnion | GeometryJson;
|
|
42
42
|
/**
|
|
43
43
|
* Settings for this feature.
|
|
44
44
|
*/
|
|
@@ -90,8 +90,8 @@ export declare class Feature extends EntityBase<FeatureProperties> {
|
|
|
90
90
|
/**
|
|
91
91
|
* The feature's geometry. For non-spatial features, this will be undefined.
|
|
92
92
|
*/
|
|
93
|
-
get geometry():
|
|
94
|
-
set geometry(value:
|
|
93
|
+
get geometry(): GeometryUnion | undefined;
|
|
94
|
+
set geometry(value: GeometryUnion | undefined);
|
|
95
95
|
/**
|
|
96
96
|
* Settings for this feature.
|
|
97
97
|
*/
|
package/data/Feature.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import t from"@arcgis/core/Graphic";import s from"@arcgis/core/core/Collection";import{fromJSON as i}from"@arcgis/core/geometry/support/jsonUtils";import{EntityBase as r}from"../Entity.js";import{Hyperlink as a}from"../Hyperlink.js";import{InvalidOperationError as o}from"../InvalidOperationError.js";import{isLayerExtension as n,isTableExtension as l,ItemType as h}from"../ItemType.js";import{serializable as u}from"../support/Serializable.js";import{CaseInsensitiveObservableMap as p}from"../utilities/CaseInsensitiveObservableMap.js";import{MapTransformCollection as c}from"../utilities/MapTransformCollection.js";import{ObservableMap as m}from"../utilities/ObservableMap.js";import{ReadOnlyMap as f}from"../utilities/ReadOnlyMap.js";import{Time as d}from"../utilities/Time.js";import g from"../utilities/_ReferenceCountedHandle.js";import{flatten as y,groupBy as _}from"../utilities/array.js";import{checkArg as b}from"../utilities/checkArg.js";import{compare as F}from"../utilities/collection.js";import{isCodedValueDomain as x,isGeometry as w}from"../utilities/esri.js";import{getArcadeExpressionFromField as v,getRelationshipFromField as I,isArcadeExpressionField as S}from"../utilities/field.js";import{parse as z,esriFormatToGeocortexFormat as A}from"../utilities/format/date.js";import{NumberFormat as E}from"../utilities/format/formats.js";import{parse as j}from"../utilities/format/number.js";import{format as T}from"../utilities/format/string.js";import{parse as k,esriFormatToGeocortexFormat as R}from"../utilities/format/time.js";import{map as C,find as O}from"../utilities/iterable.js";import{getLogger as M}from"../utilities/log.js";import{map as N}from"../utilities/promise.js";import{caseInsensitiveEquals as D}from"../utilities/string.js";import{onCollectionPropertyChange as P}from"../utilities/watch.js";import{FeatureSettings as V}from"./FeatureSettings.js";import{Schema as U}from"./Schema.js";const G=M("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let H=class extends r{attributes;get geometry(){return this._geometry}set geometry(e){this.notifyChange("geometryType"),this._geometry=w(e)||!e?e:i(e),this.schema.spatialReference=this._geometry?.spatialReference}settings;schema;attachments;expressionFieldValues;_itemType=h.FEATURE;get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0),this.notifyChange("attachmentsInitialized"),this.notifyChange("relatedFeaturesInitialized")}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get hasGlobalId(){return!!this.schema.fields.find((e=>"global-id"===e.type))}get globalId(){const e=this.schema.fields.find((e=>"global-id"===e.type));return e?this.attributes.get(e.name):void 0}set globalId(e){const t=this.schema.fields.find((e=>"global-id"===e.type));if(!t)throw new o("Cannot set global ID on feature -- no global ID field.");this.attributes.set(t.name,e)}get presentableAttributes(){return null==this._presentableAttributes&&(this._presentableAttributes=new K(this)),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new Y(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get attachmentsInitialized(){return!this.source||this._attachmentsInitialized}get relatedFeaturesInitialized(){return!this.source||this.source.relationships.every((e=>this._initializedRelationships.has(e)))}get expressionsInitialized(){return!this.settings.popupTemplate?.expressionInfos?.length||this._expressionsInitialized}get _hydrationStatus(){return this._featureHydrationStatus?this._featureHydrationStatus:this.source?.capabilities?.supportsQuery&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _key(){return`${this.source?.id}//${this.primaryKey??this.globalId??this.id}`}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){if(this.settings.popupTemplate?.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}_geometry;_source;_presentableAttributes;_hyperlinks;_featureHydrationStatus;_relatedFeatures;_expressionFieldValues=new m;_expressionValuesUpdatePending=!1;_attachmentsInitialized=!1;_expressionsInitialized=!1;_initializedRelationships=new WeakSet;_sourceRelationshipsHandle=new g((()=>P(this,"source.relationships",(()=>{this.notifyChange("relatedFeaturesInitialized")}),!0)));constructor(e){super(e),this.settings=new V,this.settings._setFeature(this),this.schema=new U,this.schema._featureSettings=this.settings,this.attachments=new s,this.attributes=new p,this._relatedFeatures=new m,this.expressionFieldValues=new $(this._expressionFieldValues,this),this.settings.watch("popupTemplate",((e,t)=>{e!==t&&(this._expressionsInitialized=!1,this.notifyChange("expressionsInitialized"))}),!0)}format(e,...t){let s="string"==typeof e?{format:e}:e;b("options",s).isNotMissing();const{format:i}=s;b("format",i).isNotMissing();let r=s.format.replace(B,W);return r=r.replace(J,((e,t,i,r,a)=>te(this,t||i,r,{...s,format:a?`{0:${a}}`:"{0}"}))),r=r.replace(q,"{{"),s={...s},s.format=r,T(s,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}toGraphic(){return toGraphic(this)}async fetchExpressionInfos(e=!1){const{expressionInfos:t}=this.settings.popupTemplate??{};if(!t)return;const{runAsyncArcadeExpression:s}=await import("../utilities/arcade.js");if(await Promise.all(t.map((async e=>{try{const t=this.source?.layer??this.source?.sublayer;let i=this.source?.mapExtension;if(!i){const e=this.source?.layerExtension;i=e?.mapExtension}this._expressionFieldValues.set(e.name,await s(e.expression,{layer:t,map:i?.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&G.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,X)}}))),e)return this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))}));this._expressionsInitialized=!0,this.notifyChange("expressionsInitialized")}async fetchRelatedFeatures(e,t){if(!this.source)return;let s=[];if(e){const t=new Set(Array.isArray(e)?e:[e]);for(const e of t){const t="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!t||!this.source.relationships.includes(t))throw new o("Relationship not found in feature source.");s.push(t)}}else s=this.source.relationships.toArray();const i=await N(s,(async e=>[e,await(async()=>{const s=await e.getRelatedFeatures(this,t);return this._initializedRelationships.add(e),s})()]));for(const e of i)this._relatedFeatures.set(e[0],e[1]);this.notifyChange("relatedFeaturesInitialized")}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);F(this.attachments,e,{equals:(e,t)=>e.id===t.id,onMissing:(e,t)=>{this.attachments.remove(e)},onNew:(e,t)=>{this.attachments.add(e)},onMatch:(e,t,s,i)=>{this.attachments.splice(s,1,t)}}),this._attachmentsInitialized=!0,this.notifyChange("attachmentsInitialized")}}async addAttachment(e){return this.source?.addAttachment(this,e)}async deleteAttachments(e){return this.source?.deleteAttachments(this,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{const t={};if("project"===e&&this.primaryKey&&(this.source?.capabilities).supportsQuery)t[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,s]of this.attributes.entries())t[e]=s;return t},deserialize:e=>{if(this.attributes.clear(),e instanceof Map||e instanceof m)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,s]of Object.entries(e))this.attributes.set(t,s)}},geometry:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("geometry"):this.geometry?.toJSON(),deserialize:e=>{this.geometry=e}},settings:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)},schema:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)},source:["project"]}}_watchProperty(e,t,s,i){if("title"===e||"description"===e){const r=super._watchProperty(e,t,s,i),a="title"===e?"settings.popupTemplate.title":"settings.popupTemplate.content",o=this.watch(a,(()=>{this.notifyChange(e)})),n=this.presentableAttributes.on("change",(()=>{this.notifyChange(e)}));return{remove(){r.remove(),o.remove(),n.remove()}}}if("relatedFeaturesInitialized"===e){const r=[this._sourceRelationshipsHandle.add(),super._watchProperty(e,t,s,i)];return{remove:()=>{for(const e of r)e.remove()}}}return super._watchProperty(e,t,s,i)}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],s=[];for(const i of e)t.includes(i)?s.push(this.fetchRelatedFeatures(i)):G.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(s)}_findRelationshipIds(...e){const t=[];for(const s of e){let e;const i=s.replace(B,W);for(;e=Q.exec(i),null!==e;){const s=e[0];t.includes(s)||t.push(e[1])}}return t}};H=e([u],H);export{H as Feature};export function toFeature(e,t){const s=new H(t);if(e.attributes){const t=e.attributes;for(const[e,i]of Object.entries(t))s.attributes.set(e,i)}return s.geometry=e.geometry,e.popupTemplate&&(s.settings.popupTemplate=e.popupTemplate),s}export function toGraphic(e){const s=new t;s.attributes={};for(const t of e.attributes.keys())s.attributes[t]=e.attributes.get(t);return n(e.source)&&e.source.layer&&(s.layer=e.source.layer),l(e.source)&&e.source.table&&(s.layer=e.source.table),s.geometry=e.geometry,e.settings.popupTemplate&&(s.popupTemplate=e.settings.popupTemplate),s}const L="Presentable attributes are read-only.",Z="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class $ extends f{_feature;_pending=new Set;constructor(e,t){super(e),this._feature=t}get(e){return super.has(e)||this._calcExpressionValue(e),super.get(e)}async _calcExpressionValue(e){if(!this._pending.has(e)){this._pending.add(e);try{const{spatialReference:t}=this._feature.schema,s=this._feature.settings.popupTemplate?.expressionInfos?.find((t=>t.name===e));if(!s)return;const{isArcadeScriptAsync:i,runAsyncArcadeExpression:r,arcadeScriptUsesGeometry:a,runArcadeExpression:o}=await import("../utilities/arcade.js");try{if(i(s.expression,t)){const i=this._feature.source?.layer??this._feature.source?.sublayer;let a=this._feature.source?.mapExtension;if(!a){const e=this._feature.source?.layerExtension;a=e?.mapExtension}this._originalMap.set(e,await r(s.expression,{feature:this._feature,layer:i,map:a?.map,spatialReference:t}))}else{if(a(s.expression,t)){const{enableGeometrySupport:e}=await import("@arcgis/core/arcade/arcade");await e()}this._originalMap.set(e,o(s.expression,{feature:this._feature,spatialReference:t}))}}catch(t){t instanceof Error&&G.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,X)}}finally{this._pending.delete(e)}}}}class K extends f{[Symbol.toStringTag];get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}_feature;_numObservers;_onAllObserversRemoved;constructor(e){super(new p),this._feature=e}clear(){throw new o(L)}delete(e){throw new o(L)}forEach(e,t){b("callback",e).isNotMissing();for(const s of this.keys())e.call(t,this.get(s),s,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){for(const t of this.keys())if(D(t,e))return!0;return!1}set(...e){throw new o(L)}*entries(){yield*C(this.keys(),(e=>[e,this.get(e)]))}*keys(){yield*this._feature.attributes.keys();for(const e of this._feature.schema.fields.expressionFields)yield e.name;if(null!=this._feature.source?.relationships)for(const e of this._feature.source.relationships)if("one-to-one"===e.cardinality||"many-to-one"===e.cardinality)for(const t of e.relatedSource.schema.fields)yield`relationships/${e.id}/${t.name}`}*values(){yield*C(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(b("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,s=()=>{for(const e of t)e.remove();t.clear()};let i;const r=()=>{const t=()=>{i&&(window.clearTimeout(i),i=void 0)};t(),i=window.setTimeout((()=>{const s=[],i=[];for(const[t,i]of this.entries())i!==e.get(t)&&s.push([t,i]);for(const[t,s]of e.entries())this.has(t)&&s===this.get(t)||i.push([t,s]);if(s.length||i.length){const e={added:s,removed:i,target:this};this.emit("change",e),a()}t()}))},a=()=>{e.clear(),s();for(const s of this.keys()){const i=this._getFieldExtension(s);let a="{0}";if(i){const e=i.watch("format",r);t.add(e),i.format&&(a=i.format)}e.set(s,this._formatAttribute(s,a))}};a();const o=this._feature.attributes.on("change",r),n=this._feature.schema.fieldExtensions.on("change",r),l=this._feature.settings.formatSettings.watch(["numberFormat","dateFormat","timeFormat","locale"],r),h=this._feature.expressionFieldValues.on("change",r),u=this._feature.schema.fields.on("change",(e=>{(e.added?.some((e=>S(e.name)))||e.removed?.some((e=>S(e.name))))&&r()})),p=this._feature.settings.watch("popupTemplate",r);this._onAllObserversRemoved=()=>{h.remove(),o.remove(),n.remove(),u.remove(),l.remove(),p.remove(),e.clear(),s()}}const s=super.on("change",t);return this._numObservers++,{remove:()=>{s.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}watch(e,t){if("size"===e){const e=this._feature.attributes.watch("size",((e,s)=>{t(e+this._feature.schema.fields._expressionFieldsLength,s+this._feature.schema.fields._expressionFieldsLength,"size",this)})),s=this._feature.schema.fields.watch("_expressionFieldsLength",((e,s)=>{t(e+this._feature.attributes.size,s+this._feature.attributes.size,"size",this)}));return{remove:()=>{e.remove(),s.remove()}}}return super.watch(e,t)}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const s=v(e);if(null!=s)return te(this._feature,"expression",s,{format:t});const[i,r]=I(e);return null!=i?te(this._feature,i,r,{format:t}):te(this._feature,void 0,e,{format:t})}}const J=/\{(?:relationships[\\/]([\w-]*)[\\/])?(?:(expression)[\\/])?([_a-zA-ZÀ-ÖØ-öø-ÿ][._a-zA-ZÀ-ÖØ-öø-ÿ0-9]*)(?::([^}]*))?\}/gi,Q=/\{relationships\/([\w-]*)[\\/]([^}]*)\}/gi,B=/{{/g,W="\0MAGIC\0",q=new RegExp(W,"g"),X="#INVALID";class Y extends c{_feature;_hyperlinks;constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return this._hyperlinks=this._hyperlinks||new WeakMap,this._hyperlinks.has(e)||this._hyperlinks.set(e,new ee(this._feature,e)),this._hyperlinks.get(e)}}let ee=class extends a{get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new o(Z)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new o(Z)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new o(Z)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new o(Z)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new o(Z)}_feature;_template;constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t}_watchProperty(e,t,s,i){const r=super._watchProperty(e,t,s,i),a=this._template.watch(e,(()=>{this.notifyChange(e)})),o=this._feature.presentableAttributes.on("change",(()=>{this.notifyChange(e)})),n=this._feature.relatedFeatures.on("change",(()=>{this.notifyChange(e)}));return{remove:()=>{r.remove(),a.remove(),o.remove(),n.remove()}}}_getSerializableProperties(){return{}}};function te(e,t,s,i={format:"{0}"}){if(!D(t,"expression")){if(t){const r=O(e.relatedFeatures.keys(),(e=>D(e.id,t)));if(!r)return G.debug("Could not resolve related field '{0}/{1}",t,s),X;const a=Array.from(e.relatedFeatures.get(r));return"many-to-one"===r.cardinality||"one-to-one"===r.cardinality?a.length<1?(G.debug("Could not resolve related field '{0}/{1}",t,s),X):se(a[0],s,i):a.map((e=>se(e,s,i))).filter((e=>""!==e)).join(",")}return se(e,s,i)}if(!e.settings.popupTemplate?.expressionInfos?.find((e=>D(e.name,s))))return G.debug("Could not find expression '{0}'.",s),X;try{const t=e.expressionFieldValues.get(s)??i.defaultExpressionValue??"",r=e.schema.findFieldByName(`expression/${s}`),a=null==r?void 0:e.schema.fieldExtensions.forField(r);return ie(e,t,s,a?.formatSettings,i)}catch(e){if(e instanceof Error)return G.error({message:"Error evaluating expression '{0}': {1}.",error:e},s,e.message),X;throw e}}function se(e,t,s){let i;if(i=e.attributes.get(t),null==i)return"";const r=e.schema.findFieldByName(t),a=e.type?.domains?.[r?.name??t],o=e=>e.codedValues?.find((e=>e.code.toString()===i.toString()))?.name??i;let n;if(D(t,e.schema.typeIdField)){const t=a&&"inherited"!==a.type?a:r?.domain;i="coded-value"===t?.type?o(t):e.type?.name??i}else if(a&&x(a))i=o(a);else if(r?.domain&&x(r.domain))i=o(r.domain);else if(r){switch(r.type){case"integer":case"small-integer":case"big-integer":case"single":case"double":i=j(i);break;case"date":i=z({timeZone:e.schema.timeZone},i);break;case"timestamp-offset":case"date-only":i=z({},i),"date-only"===r.type&&(s.isDateOnly=!0);break;case"time-only":i=k(i);break;default:i=`${i.toString()}`}const t=e.schema.fieldExtensions.forField(r);t&&(n=t.formatSettings)}return ie(e,i,t,n,s)}function ie(e,t,s,i,r){if("string"==typeof t&&(null==r.format||"{0}"===r.format))return t;const a={...r};if("number"==typeof t||t instanceof Date||t instanceof d){null==a.locale&&(a.locale=i?.locale??e.settings.formatSettings.locale);const r=e.settings.popupTemplate?.fieldInfos?.find((e=>D(e.fieldName,s)))?.format;"number"==typeof t?function(e,t,s,i){null==e.currency&&(e.currency=t?.currency??i.settings.formatSettings.currency);null==e.numberFormat&&(e.numberFormat=t?.numberFormat,null==e.numberFormat&&(e.numberFormat=null==s?i.settings.formatSettings.numberFormat:s.digitSeparator?E.NUMBER:E.FIXED_POINT));null==e.fractionalDigits&&(e.fractionalDigits=t?.fractionalDigits,null==e.fractionalDigits&&(e.fractionalDigits=null==s?i.settings.formatSettings.fractionalDigits:s.places))}(a,i,r,e):t instanceof Date?function(e,t,s,i){null==e.dateFormat&&(e.dateFormat=t?.dateFormat,null==e.dateFormat&&(e.dateFormat=null==s?i.settings.formatSettings.dateFormat:A(s.dateFormat)));null==e.timeZone&&(e.timeZone=t?.timeZone??i.settings.formatSettings.timeZone)}(a,i,r,e):function(e,t,s,i){null==e.timeFormat&&(e.timeFormat=t?.timeFormat,null==e.timeFormat&&(e.timeFormat=null==s?i.settings.formatSettings.timeFormat:R(s.dateFormat)))}(a,i,r,e)}return T(a,t)}ee=e([u],ee);export async function resolveRelatedFeatures(e){const t=_(e,(e=>e.source));await Promise.all(y([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,s])=>{t.relatedFeatures.set(e,s)}))})(e))))}
|
|
1
|
+
import{__decorate as e}from"tslib";import t from"@arcgis/core/Graphic";import s from"@arcgis/core/core/Collection";import{fromJSON as i}from"@arcgis/core/geometry/support/jsonUtils";import{EntityBase as r}from"../Entity.js";import{Hyperlink as a}from"../Hyperlink.js";import{InvalidOperationError as o}from"../InvalidOperationError.js";import{isLayerExtension as n,isTableExtension as l,ItemType as h}from"../ItemType.js";import{serializable as u}from"../support/Serializable.js";import{CaseInsensitiveObservableMap as p}from"../utilities/CaseInsensitiveObservableMap.js";import{MapTransformCollection as c}from"../utilities/MapTransformCollection.js";import{ObservableMap as m}from"../utilities/ObservableMap.js";import{ReadOnlyMap as f}from"../utilities/ReadOnlyMap.js";import{Time as d}from"../utilities/Time.js";import g from"../utilities/_ReferenceCountedHandle.js";import{flatten as y,groupBy as _}from"../utilities/array.js";import{checkArg as b}from"../utilities/checkArg.js";import{compare as F}from"../utilities/collection.js";import{isCodedValueDomain as x,isGeometry as w}from"../utilities/esri.js";import{getArcadeExpressionFromField as v,getRelationshipFromField as I,isArcadeExpressionField as S}from"../utilities/field.js";import{parse as z,esriFormatToGeocortexFormat as A}from"../utilities/format/date.js";import{NumberFormat as E}from"../utilities/format/formats.js";import{parse as j}from"../utilities/format/number.js";import{format as T}from"../utilities/format/string.js";import{parse as k,esriFormatToGeocortexFormat as R}from"../utilities/format/time.js";import{map as C,find as O}from"../utilities/iterable.js";import{getLogger as M}from"../utilities/log.js";import{map as N}from"../utilities/promise.js";import{caseInsensitiveEquals as D}from"../utilities/string.js";import{onCollectionPropertyChange as P}from"../utilities/watch.js";import{FeatureSettings as V}from"./FeatureSettings.js";import{Schema as U}from"./Schema.js";const G=M("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let H=class extends r{attributes;get geometry(){return this._geometry}set geometry(e){this.notifyChange("geometryType"),this._geometry=w(e)||!e?e:i(e),this.schema.spatialReference=this._geometry?.spatialReference}settings;schema;attachments;expressionFieldValues;_itemType=h.FEATURE;get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0),this.notifyChange("attachmentsInitialized"),this.notifyChange("relatedFeaturesInitialized")}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get hasGlobalId(){return!!this.schema.fields.find((e=>"global-id"===e.type))}get globalId(){const e=this.schema.fields.find((e=>"global-id"===e.type));return e?this.attributes.get(e.name):void 0}set globalId(e){const t=this.schema.fields.find((e=>"global-id"===e.type));if(!t)throw new o("Cannot set global ID on feature -- no global ID field.");this.attributes.set(t.name,e)}get presentableAttributes(){return null==this._presentableAttributes&&(this._presentableAttributes=new K(this)),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new Y(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get attachmentsInitialized(){return!this.source||this._attachmentsInitialized}get relatedFeaturesInitialized(){return!this.source||this.source.relationships.every((e=>this._initializedRelationships.has(e)))}get expressionsInitialized(){return!this.settings.popupTemplate?.expressionInfos?.length||this._expressionsInitialized}get _hydrationStatus(){return this._featureHydrationStatus?this._featureHydrationStatus:this.source?.capabilities?.supportsQuery&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _key(){return`${this.source?.id}//${this.primaryKey??this.globalId??this.id}`}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){if(this.settings.popupTemplate?.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}_geometry;_source;_presentableAttributes;_hyperlinks;_featureHydrationStatus;_relatedFeatures;_expressionFieldValues=new m;_expressionValuesUpdatePending=!1;_attachmentsInitialized=!1;_expressionsInitialized=!1;_initializedRelationships=new WeakSet;_sourceRelationshipsHandle=new g((()=>P(this,"source.relationships",(()=>{this.notifyChange("relatedFeaturesInitialized")}),!0)));constructor(e){super(e),this.settings=new V,this.settings._setFeature(this),this.schema=new U,this.schema._featureSettings=this.settings,this.attachments=new s,this.attributes=new p,this._relatedFeatures=new m,this.expressionFieldValues=new $(this._expressionFieldValues,this),this.settings.watch("popupTemplate",((e,t)=>{e!==t&&(this._expressionsInitialized=!1,this.notifyChange("expressionsInitialized"))}),!0)}format(e,...t){let s="string"==typeof e?{format:e}:e;b("options",s).isNotMissing();const{format:i}=s;b("format",i).isNotMissing();let r=s.format.replace(B,W);return r=r.replace(J,((e,t,i,r,a)=>te(this,t||i,r,{...s,format:a?`{0:${a}}`:"{0}"}))),r=r.replace(q,"{{"),s={...s},s.format=r,T(s,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}toGraphic(){return toGraphic(this)}async fetchExpressionInfos(e=!1){const{expressionInfos:t}=this.settings.popupTemplate??{};if(!t)return;const{runAsyncArcadeExpression:s}=await import("../utilities/arcade.js");if(await Promise.all(t.map((async e=>{try{const t=this.source?.layer??this.source?.sublayer;let i=this.source?.mapExtension;if(!i){const e=this.source?.layerExtension;i=e?.mapExtension}this._expressionFieldValues.set(e.name,await s(e.expression,{layer:t,map:i?.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&G.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,X)}}))),e)return this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))}));this._expressionsInitialized=!0,this.notifyChange("expressionsInitialized")}async fetchRelatedFeatures(e,t){if(!this.source)return;let s=[];if(e){const t=new Set(Array.isArray(e)?e:[e]);for(const e of t){const t="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!t||!this.source.relationships.includes(t))throw new o("Relationship not found in feature source.");s.push(t)}}else s=this.source.relationships.toArray();const i=await N(s,(async e=>[e,await(async()=>{const s=await e.getRelatedFeatures(this,t);return this._initializedRelationships.add(e),s})()]));for(const e of i)this._relatedFeatures.set(e[0],e[1]);this.notifyChange("relatedFeaturesInitialized")}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);F(this.attachments,e,{equals:(e,t)=>e.id===t.id,onMissing:(e,t)=>{this.attachments.remove(e)},onNew:(e,t)=>{this.attachments.add(e)},onMatch:(e,t,s,i)=>{this.attachments.splice(s,1,t)}}),this._attachmentsInitialized=!0,this.notifyChange("attachmentsInitialized")}}async addAttachment(e){return this.source?.addAttachment(this,e)}async deleteAttachments(e){return this.source?.deleteAttachments(this,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{const t={};if("project"===e&&this.primaryKey&&(this.source?.capabilities).supportsQuery)t[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,s]of this.attributes.entries())t[e]=s;return t},deserialize:e=>{if(this.attributes.clear(),e instanceof Map||e instanceof m)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,s]of Object.entries(e))this.attributes.set(t,s)}},geometry:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("geometry"):this.geometry?.toJSON(),deserialize:e=>{w(e)?this.geometry=e:this.geometry=e?i(e):void 0}},settings:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)},schema:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)},source:["project"]}}_watchProperty(e,t,s,i){if("title"===e||"description"===e){const r=super._watchProperty(e,t,s,i),a="title"===e?"settings.popupTemplate.title":"settings.popupTemplate.content",o=this.watch(a,(()=>{this.notifyChange(e)})),n=this.presentableAttributes.on("change",(()=>{this.notifyChange(e)}));return{remove(){r.remove(),o.remove(),n.remove()}}}if("relatedFeaturesInitialized"===e){const r=[this._sourceRelationshipsHandle.add(),super._watchProperty(e,t,s,i)];return{remove:()=>{for(const e of r)e.remove()}}}return super._watchProperty(e,t,s,i)}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],s=[];for(const i of e)t.includes(i)?s.push(this.fetchRelatedFeatures(i)):G.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(s)}_findRelationshipIds(...e){const t=[];for(const s of e){let e;const i=s.replace(B,W);for(;e=Q.exec(i),null!==e;){const s=e[0];t.includes(s)||t.push(e[1])}}return t}};H=e([u],H);export{H as Feature};export function toFeature(e,t){const s=new H(t);if(e.attributes){const t=e.attributes;for(const[e,i]of Object.entries(t))s.attributes.set(e,i)}return s.geometry=e.geometry,e.popupTemplate&&(s.settings.popupTemplate=e.popupTemplate),s}export function toGraphic(e){const s=new t;s.attributes={};for(const t of e.attributes.keys())s.attributes[t]=e.attributes.get(t);return n(e.source)&&e.source.layer&&(s.layer=e.source.layer),l(e.source)&&e.source.table&&(s.layer=e.source.table),s.geometry=e.geometry,e.settings.popupTemplate&&(s.popupTemplate=e.settings.popupTemplate),s}const L="Presentable attributes are read-only.",Z="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class $ extends f{_feature;_pending=new Set;constructor(e,t){super(e),this._feature=t}get(e){return super.has(e)||this._calcExpressionValue(e),super.get(e)}async _calcExpressionValue(e){if(!this._pending.has(e)){this._pending.add(e);try{const{spatialReference:t}=this._feature.schema,s=this._feature.settings.popupTemplate?.expressionInfos?.find((t=>t.name===e));if(!s)return;const{isArcadeScriptAsync:i,runAsyncArcadeExpression:r,arcadeScriptUsesGeometry:a,runArcadeExpression:o}=await import("../utilities/arcade.js");try{if(i(s.expression,t)){const i=this._feature.source?.layer??this._feature.source?.sublayer;let a=this._feature.source?.mapExtension;if(!a){const e=this._feature.source?.layerExtension;a=e?.mapExtension}this._originalMap.set(e,await r(s.expression,{feature:this._feature,layer:i,map:a?.map,spatialReference:t}))}else{if(a(s.expression,t)){const{enableGeometrySupport:e}=await import("@arcgis/core/arcade/arcade");await e()}this._originalMap.set(e,o(s.expression,{feature:this._feature,spatialReference:t}))}}catch(t){t instanceof Error&&G.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,X)}}finally{this._pending.delete(e)}}}}class K extends f{[Symbol.toStringTag];get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}_feature;_numObservers;_onAllObserversRemoved;constructor(e){super(new p),this._feature=e}clear(){throw new o(L)}delete(e){throw new o(L)}forEach(e,t){b("callback",e).isNotMissing();for(const s of this.keys())e.call(t,this.get(s),s,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){for(const t of this.keys())if(D(t,e))return!0;return!1}set(...e){throw new o(L)}*entries(){yield*C(this.keys(),(e=>[e,this.get(e)]))}*keys(){yield*this._feature.attributes.keys();for(const e of this._feature.schema.fields.expressionFields)yield e.name;if(null!=this._feature.source?.relationships)for(const e of this._feature.source.relationships)if("one-to-one"===e.cardinality||"many-to-one"===e.cardinality)for(const t of e.relatedSource.schema.fields)yield`relationships/${e.id}/${t.name}`}*values(){yield*C(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(b("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,s=()=>{for(const e of t)e.remove();t.clear()};let i;const r=()=>{const t=()=>{i&&(window.clearTimeout(i),i=void 0)};t(),i=window.setTimeout((()=>{const s=[],i=[];for(const[t,i]of this.entries())i!==e.get(t)&&s.push([t,i]);for(const[t,s]of e.entries())this.has(t)&&s===this.get(t)||i.push([t,s]);if(s.length||i.length){const e={added:s,removed:i,target:this};this.emit("change",e),a()}t()}))},a=()=>{e.clear(),s();for(const s of this.keys()){const i=this._getFieldExtension(s);let a="{0}";if(i){const e=i.watch("format",r);t.add(e),i.format&&(a=i.format)}e.set(s,this._formatAttribute(s,a))}};a();const o=this._feature.attributes.on("change",r),n=this._feature.schema.fieldExtensions.on("change",r),l=this._feature.settings.formatSettings.watch(["numberFormat","dateFormat","timeFormat","locale"],r),h=this._feature.expressionFieldValues.on("change",r),u=this._feature.schema.fields.on("change",(e=>{(e.added?.some((e=>S(e.name)))||e.removed?.some((e=>S(e.name))))&&r()})),p=this._feature.settings.watch("popupTemplate",r);this._onAllObserversRemoved=()=>{h.remove(),o.remove(),n.remove(),u.remove(),l.remove(),p.remove(),e.clear(),s()}}const s=super.on("change",t);return this._numObservers++,{remove:()=>{s.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}watch(e,t){if("size"===e){const e=this._feature.attributes.watch("size",((e,s)=>{t(e+this._feature.schema.fields._expressionFieldsLength,s+this._feature.schema.fields._expressionFieldsLength,"size",this)})),s=this._feature.schema.fields.watch("_expressionFieldsLength",((e,s)=>{t(e+this._feature.attributes.size,s+this._feature.attributes.size,"size",this)}));return{remove:()=>{e.remove(),s.remove()}}}return super.watch(e,t)}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const s=v(e);if(null!=s)return te(this._feature,"expression",s,{format:t});const[i,r]=I(e);return null!=i?te(this._feature,i,r,{format:t}):te(this._feature,void 0,e,{format:t})}}const J=/\{(?:relationships[\\/]([\w-]*)[\\/])?(?:(expression)[\\/])?([_a-zA-ZÀ-ÖØ-öø-ÿ][._a-zA-ZÀ-ÖØ-öø-ÿ0-9]*)(?::([^}]*))?\}/gi,Q=/\{relationships\/([\w-]*)[\\/]([^}]*)\}/gi,B=/{{/g,W="\0MAGIC\0",q=new RegExp(W,"g"),X="#INVALID";class Y extends c{_feature;_hyperlinks;constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return null==this._hyperlinks&&(this._hyperlinks=new WeakMap),this._hyperlinks.has(e)||this._hyperlinks.set(e,new ee(this._feature,e)),this._hyperlinks.get(e)}}let ee=class extends a{get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new o(Z)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new o(Z)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new o(Z)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new o(Z)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new o(Z)}_feature;_template;constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t}_watchProperty(e,t,s,i){const r=super._watchProperty(e,t,s,i),a=this._template.watch(e,(()=>{this.notifyChange(e)})),o=this._feature.presentableAttributes.on("change",(()=>{this.notifyChange(e)})),n=this._feature.relatedFeatures.on("change",(()=>{this.notifyChange(e)}));return{remove:()=>{r.remove(),a.remove(),o.remove(),n.remove()}}}_getSerializableProperties(){return{}}};function te(e,t,s,i={format:"{0}"}){if(!D(t,"expression")){if(t){const r=O(e.relatedFeatures.keys(),(e=>D(e.id,t)));if(!r)return G.debug("Could not resolve related field '{0}/{1}",t,s),X;const a=Array.from(e.relatedFeatures.get(r));return"many-to-one"===r.cardinality||"one-to-one"===r.cardinality?a.length<1?(G.debug("Could not resolve related field '{0}/{1}",t,s),X):se(a[0],s,i):a.map((e=>se(e,s,i))).filter((e=>""!==e)).join(",")}return se(e,s,i)}if(!e.settings.popupTemplate?.expressionInfos?.find((e=>D(e.name,s))))return G.debug("Could not find expression '{0}'.",s),X;try{const t=e.expressionFieldValues.get(s)??i.defaultExpressionValue??"",r=e.schema.findFieldByName(`expression/${s}`),a=null==r?void 0:e.schema.fieldExtensions.forField(r);return ie(e,t,s,a?.formatSettings,i)}catch(e){if(e instanceof Error)return G.error({message:"Error evaluating expression '{0}': {1}.",error:e},s,e.message),X;throw e}}function se(e,t,s){let i;if(i=e.attributes.get(t),null==i)return"";const r=e.schema.findFieldByName(t),a=e.type?.domains?.[r?.name??t],o=e=>e.codedValues?.find((e=>e.code.toString()===i.toString()))?.name??i;let n;if(D(t,e.schema.typeIdField)){const t=a&&"inherited"!==a.type?a:r?.domain;i="coded-value"===t?.type?o(t):e.type?.name??i}else if(a&&x(a))i=o(a);else if(r?.domain&&x(r.domain))i=o(r.domain);else if(r){switch(r.type){case"integer":case"small-integer":case"big-integer":case"single":case"double":i=j(i);break;case"date":i=z({timeZone:e.schema.timeZone},i);break;case"timestamp-offset":case"date-only":i=z({},i),"date-only"===r.type&&(s.isDateOnly=!0);break;case"time-only":i=k(i);break;default:i=`${i.toString()}`}const t=e.schema.fieldExtensions.forField(r);t&&(n=t.formatSettings)}return ie(e,i,t,n,s)}function ie(e,t,s,i,r){if("string"==typeof t&&(null==r.format||"{0}"===r.format))return t;const a={...r};if("number"==typeof t||t instanceof Date||t instanceof d){null==a.locale&&(a.locale=i?.locale??e.settings.formatSettings.locale);const r=e.settings.popupTemplate?.fieldInfos?.find((e=>D(e.fieldName,s)))?.format;"number"==typeof t?function(e,t,s,i){null==e.currency&&(e.currency=t?.currency??i.settings.formatSettings.currency);null==e.numberFormat&&(e.numberFormat=t?.numberFormat,null==e.numberFormat&&(e.numberFormat=null==s?i.settings.formatSettings.numberFormat:s.digitSeparator?E.NUMBER:E.FIXED_POINT));null==e.fractionalDigits&&(e.fractionalDigits=t?.fractionalDigits,null==e.fractionalDigits&&(e.fractionalDigits=null==s?i.settings.formatSettings.fractionalDigits:s.places))}(a,i,r,e):t instanceof Date?function(e,t,s,i){null==e.dateFormat&&(e.dateFormat=t?.dateFormat,null==e.dateFormat&&(e.dateFormat=null==s?i.settings.formatSettings.dateFormat:A(s.dateFormat)));null==e.timeZone&&(e.timeZone=t?.timeZone??i.settings.formatSettings.timeZone)}(a,i,r,e):function(e,t,s,i){null==e.timeFormat&&(e.timeFormat=t?.timeFormat,null==e.timeFormat&&(e.timeFormat=null==s?i.settings.formatSettings.timeFormat:R(s.dateFormat)))}(a,i,r,e)}return T(a,t)}ee=e([u],ee);export async function resolveRelatedFeatures(e){const t=_(e,(e=>e.source));await Promise.all(y([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,s])=>{t.relatedFeatures.set(e,s)}))})(e))))}
|
|
@@ -125,7 +125,7 @@ export declare class TableSchema extends Schema {
|
|
|
125
125
|
/**
|
|
126
126
|
* Maps schema properties to equivalent properties on the table.
|
|
127
127
|
*/
|
|
128
|
-
protected readonly _tableBindings: Map<keyof this, "listMode" | "title" | "url" | "id" | "gdbVersion" | "fields" | "hasM" | "hasZ" | "watch" | "get" | "set" | "emit" | "hasEventListener" | "on" | "destroy" | "destroyed" | "initialized" | "declaredClass" | "addHandles" | "removeHandles" | "hasHandles" | "labelingInfo" | "renderer" | "
|
|
128
|
+
protected readonly _tableBindings: Map<keyof this, "listMode" | "title" | "url" | "id" | "gdbVersion" | "fields" | "hasM" | "hasZ" | "watch" | "get" | "set" | "emit" | "hasEventListener" | "on" | "destroy" | "clone" | "destroyed" | "initialized" | "declaredClass" | "addHandles" | "removeHandles" | "hasHandles" | "labelingInfo" | "renderer" | "opacity" | "persistenceEnabled" | "refresh" | "spatialReference" | "mode" | "elevationInfo" | "cancelLoad" | "isFulfilled" | "isRejected" | "isResolved" | "load" | "when" | "floorInfo" | "visible" | "definitionExpression" | "outFields" | "popupEnabled" | "popupTemplate" | "createPopupTemplate" | "createQuery" | "getField" | "getFieldDomain" | "queryExtent" | "queryFeatureCount" | "queryFeatures" | "queryObjectIds" | "objectIdField" | "geometryType" | "labelsVisible" | "customParameters" | "layerId" | "legendEnabled" | "formTemplate" | "refreshInterval" | "blendMode" | "effect" | "maxScale" | "minScale" | "copyright" | "fullExtent" | "portalItem" | "source" | "displayFilterEnabled" | "displayFilterInfo" | "parent" | "addAttachment" | "deleteAttachments" | "apiKey" | "visibilityTimeExtent" | "createLayerView" | "fetchAttributionData" | "displayField" | "typeIdField" | "types" | "save" | "saveAs" | "dateFieldsTimeZone" | "screenSizePerspectiveEnabled" | "useViewTime" | "attributeTableTemplate" | "featureEffect" | "featureReduction" | "orderBy" | "timeExtent" | "timeInfo" | "timeOffset" | "trackInfo" | "queryAttributeBins" | "returnM" | "returnZ" | "sourceJSON" | "historicMoment" | "charts" | "dynamicDataSource" | "editingEnabled" | "templates" | "applyEdits" | "getFeatureType" | "queryAttachments" | "queryRelatedFeatures" | "queryRelatedFeaturesCount" | "queryTopFeatureCount" | "queryTopFeatures" | "queryTopFeaturesExtent" | "queryTopObjectIds" | "updateAttachment">;
|
|
129
129
|
/**
|
|
130
130
|
* The collection of fields.
|
|
131
131
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError as t}from"../../ArgumentError.js";import{InvalidOperationError as e}from"../../InvalidOperationError.js";import{isLayerExtension as r,isSublayerExtension as a,isTableExtension as o}from"../../ItemType.js";import{DefaultArcGISRequestHelper as s}from"../../support/ArcGISRequestHelper.js";import{isSublayer as n,isWFSLayer as i}from"../../utilities/_layers.js";import{checkArg as c}from"../../utilities/checkArg.js";import{isCSVLayerExtension as p,isFeatureLayerExtension as m,isGeoJSONLayerExtension as h,isMapImageSublayerExtension as l,isSceneLayerExtension as u,isSubtypeGroupLayerExtension as d,isSubtypeSublayerExtension as f,isWFSLayerExtension as y}from"../../utilities/extensions.js";import{isCSVLayer as w,isFeatureLayer as A,isGeoJSONLayer as E,isSceneLayer as T,isSubtypeGroupLayer as b,isSubtypeSublayer as g}from"../../utilities/layers.js";const x=new s;export async function toAttachmentFile(t,e){let r;if(t instanceof File)r=t;else if(t?.url)try{const e=await x.request(t.url,{responseType:"blob"});r=new File([e.data],t.title??"",{type:t.contentType})}catch(t){throw new Error((e?`${e} `:"")+"Failed to fetch attachment from url.",{cause:t})}if(!r)throw new Error((e?`${e} `:"")+"No attachment data found.");return r}export function supportsAttachments(t){if(o(t))return!!t.table.capabilities?.data?.supportsAttachment;if(l(t))return!!t.sublayer.capabilities?.data?.supportsAttachment;let e=t;return(f(t)||a(t))&&(e=t.layerExtension),(m(e)||d(e)||p(e)||h(e)||u(e)||y(e))&&!!e.layer.capabilities?.data?.supportsAttachment}export function supportsAttachmentEditing(t){const e=g(t)||n(t)?t.layer:t;return(A(e)||b(e)||w(e)||E(e)||T(e)||i(e))&&!!e.capabilities?.data?.supportsAttachment&&(e.capabilities.operations?.supportsUpdate||e.capabilities.operations?.supportsAdd)}export async function addAttachment(a,s,n,i){if(c("feature",a).isDefined(),c("layer",s).isDefined(),c("attachment",n).isDefined(),r(a.source)&&a.source.layer!==s||o(a.source)&&a.source.table!==s)throw new t("layer","The feature's source layer/table does not match the layer.");if(!supportsAttachmentEditing(s))throw new e("Cannot add attachment; the Table does not support attachments.");const p=`Failed to add attachment to ${a.primaryKey??a.id} of source ${a.source?.title??a.source?.id}.`,m=await toAttachmentFile(n,p),h=m.name?.split(".").pop()?.toLowerCase();if(i?.attachmentTypes&&!function(t,e){if(!e.map((t=>t.toLowerCase())).includes(t.type.toLowerCase())){const r=e.filter((t=>!t.includes("/"))).map((t=>t.toLowerCase())),a=t.name?.split(".").pop()?.toLowerCase();return null!=a&&r.includes(a)}return!0}(m,i.attachmentTypes))throw new t("attachment",`The attachment type '${h}' does not exist in the set of accepted attachment types: ${i.attachmentTypes}.`);let l;const u=new FormData;u.append("attachment",m,m.name);try{const t=await s.addAttachment(a.toGraphic(),u);if(t.error)throw new Error(t.error.message);l=`${t.objectId}`}catch(t){throw new Error(p,{cause:t})}return await a.fetchAttachments(),a.attachments.find((t=>t.id===l))}export function isAttachmentTypeError(t){return ATTACHMENT_TYPE_ERROR_REGEX.test(t.message)}export const ATTACHMENT_TYPE_ERROR_REGEX=/^The attachment type .+ does not exist in the set of accepted attachment types: .+.$/;export async function deleteAttachments(a,s,n){if(c("feature",a).isDefined(),c("layer",s).isDefined(),c("attachments",n).isDefined(),r(a.source)&&a.source.layer!==s||o(a.source)&&a.source.table!==s)throw new t("layer","The feature's source layer/table does not match the layer.");if(!supportsAttachmentEditing(s))throw new e("Cannot delete attachments; the layer/table does not support attachments.");const i=`Failed to delete attachment(s) from ${a.primaryKey??a.id} of source ${a.source?.title??a.source?.id}.`;try{const t=await s.deleteAttachments(a.toGraphic(),n.map((t=>"string"==typeof t?+t:+t.id)));if(t?.length>1){const e=t.filter((t=>t.error));if(e.length>0)throw new AggregateError(e.map((t=>new Error(t.error
|
|
1
|
+
import{ArgumentError as t}from"../../ArgumentError.js";import{InvalidOperationError as e}from"../../InvalidOperationError.js";import{isLayerExtension as r,isSublayerExtension as a,isTableExtension as o}from"../../ItemType.js";import{DefaultArcGISRequestHelper as s}from"../../support/ArcGISRequestHelper.js";import{isSublayer as n,isWFSLayer as i}from"../../utilities/_layers.js";import{checkArg as c}from"../../utilities/checkArg.js";import{isCSVLayerExtension as p,isFeatureLayerExtension as m,isGeoJSONLayerExtension as h,isMapImageSublayerExtension as l,isSceneLayerExtension as u,isSubtypeGroupLayerExtension as d,isSubtypeSublayerExtension as f,isWFSLayerExtension as y}from"../../utilities/extensions.js";import{isCSVLayer as w,isFeatureLayer as A,isGeoJSONLayer as E,isSceneLayer as T,isSubtypeGroupLayer as b,isSubtypeSublayer as g}from"../../utilities/layers.js";const x=new s;export async function toAttachmentFile(t,e){let r;if(t instanceof File)r=t;else if(t?.url)try{const e=await x.request(t.url,{responseType:"blob"});r=new File([e.data],t.title??"",{type:t.contentType})}catch(t){throw new Error((e?`${e} `:"")+"Failed to fetch attachment from url.",{cause:t})}if(!r)throw new Error((e?`${e} `:"")+"No attachment data found.");return r}export function supportsAttachments(t){if(o(t))return!!t.table.capabilities?.data?.supportsAttachment;if(l(t))return!!t.sublayer.capabilities?.data?.supportsAttachment;let e=t;return(f(t)||a(t))&&(e=t.layerExtension),(m(e)||d(e)||p(e)||h(e)||u(e)||y(e))&&!!e.layer.capabilities?.data?.supportsAttachment}export function supportsAttachmentEditing(t){const e=g(t)||n(t)?t.layer:t;return(A(e)||b(e)||w(e)||E(e)||T(e)||i(e))&&!!e.capabilities?.data?.supportsAttachment&&(e.capabilities.operations?.supportsUpdate||e.capabilities.operations?.supportsAdd)}export async function addAttachment(a,s,n,i){if(c("feature",a).isDefined(),c("layer",s).isDefined(),c("attachment",n).isDefined(),r(a.source)&&a.source.layer!==s||o(a.source)&&a.source.table!==s)throw new t("layer","The feature's source layer/table does not match the layer.");if(!supportsAttachmentEditing(s))throw new e("Cannot add attachment; the Table does not support attachments.");const p=`Failed to add attachment to ${a.primaryKey??a.id} of source ${a.source?.title??a.source?.id}.`,m=await toAttachmentFile(n,p),h=m.name?.split(".").pop()?.toLowerCase();if(i?.attachmentTypes&&!function(t,e){if(!e.map((t=>t.toLowerCase())).includes(t.type.toLowerCase())){const r=e.filter((t=>!t.includes("/"))).map((t=>t.toLowerCase())),a=t.name?.split(".").pop()?.toLowerCase();return null!=a&&r.includes(a)}return!0}(m,i.attachmentTypes))throw new t("attachment",`The attachment type '${h}' does not exist in the set of accepted attachment types: ${i.attachmentTypes}.`);let l;const u=new FormData;u.append("attachment",m,m.name);try{const t=await s.addAttachment(a.toGraphic(),u);if(t.error)throw new Error(t.error.message);l=`${t.objectId}`}catch(t){throw new Error(p,{cause:t})}return await a.fetchAttachments(),a.attachments.find((t=>t.id===l))}export function isAttachmentTypeError(t){return ATTACHMENT_TYPE_ERROR_REGEX.test(t.message)}export const ATTACHMENT_TYPE_ERROR_REGEX=/^The attachment type .+ does not exist in the set of accepted attachment types: .+.$/;export async function deleteAttachments(a,s,n){if(c("feature",a).isDefined(),c("layer",s).isDefined(),c("attachments",n).isDefined(),r(a.source)&&a.source.layer!==s||o(a.source)&&a.source.table!==s)throw new t("layer","The feature's source layer/table does not match the layer.");if(!supportsAttachmentEditing(s))throw new e("Cannot delete attachments; the layer/table does not support attachments.");const i=`Failed to delete attachment(s) from ${a.primaryKey??a.id} of source ${a.source?.title??a.source?.id}.`;try{const t=await s.deleteAttachments(a.toGraphic(),n.map((t=>"string"==typeof t?+t:+t.id)));if(t?.length>1){const e=t.filter((t=>t.error));if(e.length>0)throw new AggregateError(e.map((t=>new Error(t.error?.message))))}else if(t?.[0]?.error)throw new Error(t?.[0].error.message)}catch(t){throw new Error(i,{cause:t})}await a.fetchAttachments()}
|
|
@@ -308,12 +308,6 @@ declare namespace __esri {
|
|
|
308
308
|
data: BuildingComponentSublayerCapabilitiesData;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
export interface ImageryLayer {
|
|
312
|
-
// This used to be exposed publicly, now it's private and their docs
|
|
313
|
-
// specify that raster fields are always prefixed with "Raster."
|
|
314
|
-
_rasterAttributeTableFieldPrefix: string;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
311
|
export interface StreamLayerView {
|
|
318
312
|
createQuery(): __esri.supportQuery;
|
|
319
313
|
view: __esri.MapView | __esri.SceneView;
|
|
@@ -357,4 +351,8 @@ declare namespace __esri {
|
|
|
357
351
|
// The type property is required for autocasting to work.
|
|
358
352
|
type: Symbol3DLayer["type"];
|
|
359
353
|
}
|
|
354
|
+
|
|
355
|
+
export interface Accessor {
|
|
356
|
+
get<T = unknown>(propertyPath: string): T;
|
|
357
|
+
}
|
|
360
358
|
}
|