@vertigis/arcgis-extensions 38.0.5 → 38.1.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/AccessDeniedError.js +1 -1
- package/AppConfig.schema.json +35 -39
- package/ArgumentMissingError.js +1 -1
- package/ArgumentOutOfRangeError.js +1 -1
- package/Entity.js +1 -1
- package/FailureMode.d.ts +1 -1
- package/Hyperlink.js +1 -1
- package/LanguageResources.d.ts +1 -3
- package/LanguageResources.js +1 -1
- package/NotFoundError.js +1 -1
- package/PortalUri.js +1 -1
- package/data/ArcGISServiceTableExtension.js +1 -1
- package/data/Attachment.js +1 -1
- package/data/Feature.js +1 -1
- package/data/FeatureList.d.ts +3 -3
- package/data/FeatureList.js +1 -1
- package/data/FeatureSaveError.js +1 -1
- package/data/FeatureSet.js +1 -1
- package/data/FeatureSettings.js +1 -1
- package/data/FeatureSourceBase.js +1 -1
- package/data/FeatureStream.js +1 -1
- package/data/FieldExtension.js +1 -1
- package/data/PopupContentExtension.js +1 -1
- package/data/Relationship.js +1 -1
- package/data/RelationshipBase.js +1 -1
- package/data/Schema.js +1 -1
- package/data/Table.js +1 -1
- package/data/TableExtension.js +1 -1
- package/data/TaskSettings.js +1 -1
- package/data/_Relationship.d.ts +3 -3
- package/data/_Relationship.js +1 -1
- package/data/_TableExtension.js +1 -1
- package/data/convert.js +1 -1
- package/data/support/DefaultRelationshipFactory.js +1 -1
- package/data/support/DefaultTableExtensionFactory.js +1 -1
- package/data/support/attachments.js +1 -1
- package/docs/html/assets/main.js +56 -52
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +23 -0
- package/docs/html/classes/data_FeatureSet.FeatureSet.html +2 -2
- package/docs/html/classes/data_FeatureStream.FeatureStream.html +1 -1
- package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +2 -2
- package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +2 -2
- package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +1 -1
- package/docs/html/classes/utilities_asyncIterable.AsyncQueue.html +1 -1
- package/docs/html/classes/utilities_date.DateFormatter.html +1 -1
- package/docs/html/classes/utilities_string.StringFormatter.html +6 -24
- package/docs/html/functions/utilities_string.format.html +2 -18
- package/docs/html/interfaces/LanguageResources.LanguageResourcesProperties.html +2 -7
- package/docs/html/interfaces/data_support_attachments.AttachmentEnabledLayer.html +4 -6
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerBaseProperties.html +1 -1
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerProperties.html +1 -1
- package/docs/html/interfaces/portal_ApplicationProperties.ApplicationProperties.html +15 -12
- package/docs/html/interfaces/portal_Background.ColorBackground.html +3 -2
- package/docs/html/interfaces/portal_BaseMap.BaseMap-1.html +2 -1
- package/docs/html/interfaces/portal_BaseMapLayer.BaseMapLayerBase.html +2 -1
- package/docs/html/interfaces/portal_BingLayer.BingLayer.html +2 -1
- package/docs/html/interfaces/portal_Bookmark.Bookmark.html +2 -1
- package/docs/html/interfaces/portal_BuildingSceneLayer.BuildingSceneLayer-1.html +1 -1
- package/docs/html/interfaces/portal_CIMSymbol.CIMSymbol.html +2 -1
- package/docs/html/interfaces/portal_CSVLayer.CSVLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Camera.Camera-1.html +2 -1
- package/docs/html/interfaces/portal_ClassBreaksRenderer.ClassBreakInfo.html +2 -1
- package/docs/html/interfaces/portal_ClassBreaksRenderer.ClassBreaksRenderer.html +2 -1
- package/docs/html/interfaces/portal_CodedValueDomain.CodedValue.html +1 -1
- package/docs/html/interfaces/portal_CodedValueDomain.CodedValueDomain-1.html +1 -1
- package/docs/html/interfaces/portal_ColorClassBreakInfo.ColorClassBreakInfo.html +2 -1
- package/docs/html/interfaces/portal_ColorUniqueValueInfos.ColorUniqueValueInfos.html +2 -1
- package/docs/html/interfaces/portal_DataSource.DataSourceBase.html +2 -2
- package/docs/html/interfaces/portal_DefinitionEditor.DefinitionEditor.html +2 -1
- package/docs/html/interfaces/portal_DefinitionEditor.Input.html +1 -1
- package/docs/html/interfaces/portal_DefinitionEditor.Parameter.html +1 -1
- package/docs/html/interfaces/portal_DrawingInfo.DrawingInfo-1.html +2 -1
- package/docs/html/interfaces/portal_DynamicDataLayer.DynamicDataLayer.html +2 -2
- package/docs/html/interfaces/portal_DynamicMapLayer.DynamicMapLayer.html +1 -1
- package/docs/html/interfaces/portal_ElevationInfo.ElevationInfo-1.html +1 -1
- package/docs/html/interfaces/portal_ElevationLayer.ElevationLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Environment.Environment-1.html +2 -1
- package/docs/html/interfaces/portal_Extent.Extent.html +1 -1
- package/docs/html/interfaces/portal_ExtrudeSymbol3DLayer.ExtrudeSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_Feature.Feature-1.html +2 -1
- package/docs/html/interfaces/portal_FeatureCollection.FeatureCollection.html +2 -1
- package/docs/html/interfaces/portal_FeatureLayer.FeatureLayer-1.html +3 -2
- package/docs/html/interfaces/portal_FeatureSet.FeatureSet.html +2 -1
- package/docs/html/interfaces/portal_Field.Field-1.html +1 -1
- package/docs/html/interfaces/portal_FieldInfo.FieldInfo.html +2 -1
- package/docs/html/interfaces/portal_FillSymbol3DLayer.FillSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_FormInfo.FormAttachmentElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormBarcodeScannerInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormComboBoxInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormDateTimePickerInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormExpressionInfo.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormFieldElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormGroupElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormInfo-1.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormRadioButtonsInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormRelationshipElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormSwitchInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormTextAreaInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormTextBoxInput.html +1 -1
- package/docs/html/interfaces/portal_Format.Format.html +2 -1
- package/docs/html/interfaces/portal_GeoRSSLayer.GeoRSSLayer-1.html +3 -2
- package/docs/html/interfaces/portal_GroupLayer.GroupLayer-1.html +3 -2
- package/docs/html/interfaces/portal_HeatmapRenderer.ColorStop.html +2 -1
- package/docs/html/interfaces/portal_HeatmapRenderer.HeatmapRenderer.html +2 -1
- package/docs/html/interfaces/portal_IconSymbol3DLayer.IconSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_ImageServiceLayer.ImageServiceLayer-1.html +3 -2
- package/docs/html/interfaces/portal_ImageServiceVectorLayer.ImageServiceVectorLayer.html +3 -2
- package/docs/html/interfaces/portal_InheritedDomain.InheritedDomain-1.html +1 -1
- package/docs/html/interfaces/portal_InitialState.InitialState-1.html +2 -1
- package/docs/html/interfaces/portal_IntegratedMeshLayer.IntegratedMeshLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Item.Item-1.html +3 -2
- package/docs/html/interfaces/portal_JoinTableDataSource.JoinTableDataSource.html +2 -2
- package/docs/html/interfaces/portal_KMLLayer.KMLLayer-1.html +3 -2
- package/docs/html/interfaces/portal_LabelSymbol3D.LabelSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_LabelingInfo.LabelingInfo-1.html +3 -2
- package/docs/html/interfaces/portal_Layer.Layer-1.html +1 -1
- package/docs/html/interfaces/portal_LayerDefinition.FieldOverride.html +1 -1
- package/docs/html/interfaces/portal_LayerDefinition.LayerDefinition-1.html +4 -3
- package/docs/html/interfaces/portal_LayerDefinition.LayerTimeInfo.html +2 -2
- package/docs/html/interfaces/portal_Lighting.SunLighting.html +2 -1
- package/docs/html/interfaces/portal_Lighting.VirtualLighting.html +2 -1
- package/docs/html/interfaces/portal_LineSymbol3D.LineSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_LineSymbol3DLayer.LineSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_LocationInfo.LocationInfo.html +2 -1
- package/docs/html/interfaces/portal_MapFloorInfo.FacilityLayerInfo.html +1 -1
- package/docs/html/interfaces/portal_MapFloorInfo.LevelLayerInfo.html +1 -1
- package/docs/html/interfaces/portal_MapFloorInfo.MapFloorInfo-1.html +1 -1
- package/docs/html/interfaces/portal_MapFloorInfo.SiteLayerInfo.html +1 -1
- package/docs/html/interfaces/portal_MapRangeInfo.MapRangeInfo.html +2 -1
- package/docs/html/interfaces/portal_MapServiceLayer.MapServiceLayer-1.html +3 -2
- package/docs/html/interfaces/portal_MeshSymbol3D.MeshSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_MosaicRule.MosaicRule-1.html +2 -1
- package/docs/html/interfaces/portal_Multipoint.Multipoint.html +1 -1
- package/docs/html/interfaces/portal_ObjectSymbol3DLayer.ObjectSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_OpenStreetMapLayer.OpenStreetMapLayer-1.html +2 -1
- package/docs/html/interfaces/portal_OperationalLayer.OperationalLayerBase.html +1 -1
- package/docs/html/interfaces/portal_PathSymbol3DLayer.PathSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_PictureFillSymbol.PictureFillSymbol.html +2 -1
- package/docs/html/interfaces/portal_PictureMarkerSymbol.PictureMarkerSymbol.html +2 -1
- package/docs/html/interfaces/portal_Point.Point.html +2 -1
- package/docs/html/interfaces/portal_PointCloudBitfieldFilter.PointCloudBitfieldFilter.html +2 -1
- package/docs/html/interfaces/portal_PointCloudClassBreaksRenderer.PointCloudClassBreaksRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudFixedSizeAlgorithm.PointCloudFixedSizeAlgorithm.html +2 -1
- package/docs/html/interfaces/portal_PointCloudLayer.PointCloudLayer-1.html +3 -2
- package/docs/html/interfaces/portal_PointCloudRGBRenderer.PointCloudRGBRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudRenderer.PointCloudRendererBase.html +4 -2
- package/docs/html/interfaces/portal_PointCloudReturnFilter.PointCloudReturnFilter.html +2 -1
- package/docs/html/interfaces/portal_PointCloudSplatAlgorithm.PointCloudSplatAlgorithm.html +2 -1
- package/docs/html/interfaces/portal_PointCloudStretchRenderer.PointCloudStretchRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudUniqueValueRenderer.PointCloudUniqueValueRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudValueFilter.PointCloudValueFilter.html +2 -1
- package/docs/html/interfaces/portal_PointSymbol3D.PointSymbol3D.html +3 -2
- package/docs/html/interfaces/portal_Polygon.Polygon.html +1 -1
- package/docs/html/interfaces/portal_PolygonSymbol3D.PolygonSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_Polyline.Polyline.html +1 -1
- package/docs/html/interfaces/portal_PopupExpressionInfo.PopupExpressionInfo.html +2 -1
- package/docs/html/interfaces/portal_PopupInfo.OrderByFields.html +2 -1
- package/docs/html/interfaces/portal_PopupInfo.RelatedRecordsInfo.html +2 -1
- package/docs/html/interfaces/portal_PredominanceRenderer.PredominanceRenderer.html +2 -1
- package/docs/html/interfaces/portal_Presentation.Presentation-1.html +2 -1
- package/docs/html/interfaces/portal_QueryTableDataSource.QueryTableDataSource.html +2 -2
- package/docs/html/interfaces/portal_RangeDomain.RangeDomain-1.html +1 -1
- package/docs/html/interfaces/portal_RangeInfo.RangeInfo.html +2 -1
- package/docs/html/interfaces/portal_RasterDataSource.RasterDataSource.html +2 -2
- package/docs/html/interfaces/portal_Renderer.AuthoringInfo.html +2 -1
- package/docs/html/interfaces/portal_Renderer.ColorRamp.html +1 -1
- package/docs/html/interfaces/portal_Renderer.RendererBase.html +2 -1
- package/docs/html/interfaces/portal_RenderingRule.RenderingRule-1.html +3 -2
- package/docs/html/interfaces/portal_SceneLayer.SceneLayer-1.html +3 -2
- package/docs/html/interfaces/portal_SimpleFillSymbol.SimpleFillSymbol.html +2 -1
- package/docs/html/interfaces/portal_SimpleLineSymbol.SimpleLineSymbol.html +2 -1
- package/docs/html/interfaces/portal_SimpleMarkerSymbol.SimpleMarkerSymbol.html +2 -1
- package/docs/html/interfaces/portal_SimpleRenderer.SimpleRenderer.html +2 -1
- package/docs/html/interfaces/portal_Slide.Slide-1.html +4 -4
- package/docs/html/interfaces/portal_SpatialReference.SpatialReference-1.html +2 -1
- package/docs/html/interfaces/portal_StreamLayer.StreamLayer-1.html +2 -2
- package/docs/html/interfaces/portal_StyleSymbolReference.StyleSymbolReference.html +2 -1
- package/docs/html/interfaces/portal_SubtypeGroupLayer.SubtypeGroupLayer-1.html +3 -2
- package/docs/html/interfaces/portal_SubtypeGroupLayer.SubtypeSubtypeGroupLayer.html +2 -2
- package/docs/html/interfaces/portal_SubtypeSublayer.SubtypeSublayer-1.html +3 -2
- package/docs/html/interfaces/portal_Symbol.Font.html +1 -1
- package/docs/html/interfaces/portal_Symbol3D.Material.html +2 -1
- package/docs/html/interfaces/portal_Symbol3D.Outline.html +2 -1
- package/docs/html/interfaces/portal_Symbol3D.ResourceIconSymbol.html +2 -1
- package/docs/html/interfaces/portal_Symbol3D.ResourceObjectSymbol.html +2 -1
- package/docs/html/interfaces/portal_Table.Table.html +1 -1
- package/docs/html/interfaces/portal_TableDataSource.TableDataSource.html +2 -2
- package/docs/html/interfaces/portal_Template.Template-1.html +2 -1
- package/docs/html/interfaces/portal_TemporalRenderer.TemporalRenderer.html +2 -1
- package/docs/html/interfaces/portal_TextSymbol.TextSymbol.html +2 -1
- package/docs/html/interfaces/portal_TextSymbol3DLayer.TextSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_TileInfo.TileInfo-1.html +3 -2
- package/docs/html/interfaces/portal_TiledImageServiceLayer.TiledImageServiceLayer-1.html +3 -2
- package/docs/html/interfaces/portal_TiledMapServiceLayer.TiledMapServiceLayer-1.html +4 -3
- package/docs/html/interfaces/portal_Type.Type-1.html +3 -8
- package/docs/html/interfaces/portal_UniqueValueFromStyle.UniqueValueFromStyle.html +2 -1
- package/docs/html/interfaces/portal_UniqueValueRenderer.UniqueValueInfo.html +2 -1
- package/docs/html/interfaces/portal_UniqueValueRenderer.UniqueValueRenderer.html +2 -1
- package/docs/html/interfaces/portal_UtilityNetwork.TraceConfiguration.html +1 -1
- package/docs/html/interfaces/portal_UtilityNetwork.UtilityNetwork-1.html +1 -1
- package/docs/html/interfaces/portal_Value.Value.html +1 -1
- package/docs/html/interfaces/portal_VectorTileLayer.VectorTileLayer-1.html +3 -2
- package/docs/html/interfaces/portal_VerticalOffset.VerticalOffset.html +1 -1
- package/docs/html/interfaces/portal_Viewpoint.Viewpoint-1.html +2 -1
- package/docs/html/interfaces/portal_VisualVariable.ColorInfo.html +3 -2
- package/docs/html/interfaces/portal_VisualVariable.RotationInfo.html +3 -2
- package/docs/html/interfaces/portal_VisualVariable.Size.html +2 -1
- package/docs/html/interfaces/portal_VisualVariable.SizeInfo.html +3 -2
- package/docs/html/interfaces/portal_VisualVariable.TransparencyInfo.html +2 -1
- package/docs/html/interfaces/portal_VisualVariable.VisualVariableBase.html +1 -1
- package/docs/html/interfaces/portal_WMSLayer.WMSLayer-1.html +3 -2
- package/docs/html/interfaces/portal_WMSSublayer.WMSSublayer-1.html +2 -1
- package/docs/html/interfaces/portal_WMTSInfo.WMTSInfo-1.html +1 -1
- package/docs/html/interfaces/portal_Weather.CloudyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.FoggyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.RainyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.SnowyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.SunnyWeather.html +2 -1
- package/docs/html/interfaces/portal_WebMap.WebMap-1.html +3 -3
- package/docs/html/interfaces/portal_WebScene.WebScene-1.html +5 -3
- package/docs/html/interfaces/portal_WebSceneBaseMap.WebSceneBaseMap-1.html +2 -1
- package/docs/html/interfaces/portal_WebTileLayer.WebTileLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Widgets.FloorFilter.html +1 -1
- package/docs/html/interfaces/portal_Widgets.Range.html +1 -1
- package/docs/html/interfaces/portal_Widgets.TimeSlider.html +3 -2
- package/docs/html/interfaces/portal_Widgets.Widgets.html +2 -1
- package/docs/html/interfaces/support_Serializable.PropertyDef.html +2 -2
- package/docs/html/interfaces/tasks_identify_IdentifyOptions.IdentifyOptions-1.html +2 -2
- package/docs/html/interfaces/tasks_search_SearchOptions.SearchOptions-1.html +2 -2
- package/docs/html/interfaces/utilities_array.CompareOptions.html +8 -8
- package/docs/html/interfaces/utilities_geometry.GeographicTransformationJson.html +1 -1
- package/docs/html/types/portal_DataSource.DataSource.html +1 -0
- package/docs/html/types/portal_Domain.Domain-1.html +2 -1
- package/docs/html/types/portal_Geometry.Geometry.html +1 -1
- package/docs/html/types/portal_PointCloudFilter.PointCloudFilter.html +2 -1
- package/docs/html/types/portal_Symbol.Color.html +1 -1
- package/docs/html/types/portal_Symbol.Symbol.html +1 -1
- package/docs/html/types/portal_Symbol3D.Symbol3D.html +2 -1
- package/docs/html/types/portal_VisualVariable.VisualVariable.html +2 -1
- package/docs/html/variables/mapping_BasemapExtension.defaultBasemapExtensionFactory.html +2 -2
- package/docs/html/variables/version.version.html +1 -1
- package/forked-libs/dbf/src/fields.js +1 -1
- package/forked-libs/dbf/src/structure.js +1 -1
- package/forked-libs/shp-write/src/download.js +1 -1
- package/forked-libs/shp-write/src/fields.js +1 -1
- package/forked-libs/shp-write/src/geojson.js +1 -1
- package/forked-libs/shp-write/src/multipoint.js +1 -1
- package/forked-libs/shp-write/src/points.js +1 -1
- package/forked-libs/shp-write/src/poly.js +1 -1
- package/forked-libs/shp-write/src/write.js +1 -1
- package/forked-libs/shp-write/src/zip.js +1 -1
- package/layer-preset/LayerPreset.d.ts +1 -1
- package/layer-preset/LayerPreset.js +1 -1
- package/layer-preset/LayerPresetSettings.d.ts +1 -1
- package/layer-preset/LayerPresetSettings.js +1 -1
- package/locale/_registry.js +1 -1
- package/locale/af.js +1 -1
- package/locale/ar-MA.js +1 -1
- package/locale/ar-SA.js +1 -1
- package/locale/ar-TN.js +1 -1
- package/locale/ar.js +1 -1
- package/locale/az.js +1 -1
- package/locale/be.js +1 -1
- package/locale/bg.js +1 -1
- package/locale/bn.js +1 -1
- package/locale/bs.js +1 -1
- package/locale/ca.js +1 -1
- package/locale/cs.js +1 -1
- package/locale/cv.js +1 -1
- package/locale/cy.js +1 -1
- package/locale/da.js +1 -1
- package/locale/de-AT.js +1 -1
- package/locale/de.js +1 -1
- package/locale/el.js +1 -1
- package/locale/en-AU.js +1 -1
- package/locale/en-CA.js +1 -1
- package/locale/en-GB.js +1 -1
- package/locale/en.js +1 -1
- package/locale/es.js +1 -1
- package/locale/et.js +1 -1
- package/locale/eu.js +1 -1
- package/locale/fa.js +1 -1
- package/locale/fi.js +1 -1
- package/locale/fo.js +1 -1
- package/locale/fr-CA.js +1 -1
- package/locale/fr.js +1 -1
- package/locale/gl.js +1 -1
- package/locale/he.js +1 -1
- package/locale/hi.js +1 -1
- package/locale/hr.js +1 -1
- package/locale/hu.js +1 -1
- package/locale/hy.js +1 -1
- package/locale/id.js +1 -1
- package/locale/inv.js +1 -1
- package/locale/is.js +1 -1
- package/locale/it.js +1 -1
- package/locale/ja.js +1 -1
- package/locale/ka.js +1 -1
- package/locale/km.js +1 -1
- package/locale/ko.js +1 -1
- package/locale/language.js +1 -1
- package/locale/lt.js +1 -1
- package/locale/lv.js +1 -1
- package/locale/mk.js +1 -1
- package/locale/ml.js +1 -1
- package/locale/mr.js +1 -1
- package/locale/ms-MY.js +1 -1
- package/locale/ms.js +1 -1
- package/locale/my.js +1 -1
- package/locale/nb.js +1 -1
- package/locale/ne.js +1 -1
- package/locale/nl.js +1 -1
- package/locale/nn.js +1 -1
- package/locale/no.js +1 -1
- package/locale/pl.js +1 -1
- package/locale/pt-BR.js +1 -1
- package/locale/pt.js +1 -1
- package/locale/ro.js +1 -1
- package/locale/ru.js +1 -1
- package/locale/si.js +1 -1
- package/locale/sk.js +1 -1
- package/locale/sl.js +1 -1
- package/locale/sq.js +1 -1
- package/locale/sr-Cyrl.js +1 -1
- package/locale/sr-ME.js +1 -1
- package/locale/sr.js +1 -1
- package/locale/sv.js +1 -1
- package/locale/ta.js +1 -1
- package/locale/th.js +1 -1
- package/locale/tl.js +1 -1
- package/locale/tr.js +1 -1
- package/locale/tzm-Latn.js +1 -1
- package/locale/tzm.js +1 -1
- package/locale/uk.js +1 -1
- package/locale/uz.js +1 -1
- package/locale/vi.js +1 -1
- package/locale/zh-TW.js +1 -1
- package/locale/zh.js +1 -1
- package/locale.js +1 -1
- package/mapping/ArcGISSublayerExtension.js +1 -1
- package/mapping/BasemapExtension.js +1 -1
- package/mapping/Bookmark.d.ts +1 -1
- package/mapping/Bookmark.js +1 -1
- package/mapping/BuildingComponentSublayerExtension.js +1 -1
- package/mapping/BuildingGroupSublayerExtension.js +1 -1
- package/mapping/BuildingSceneLayerExtension.js +1 -1
- package/mapping/BuildingSublayerExtension.js +1 -1
- package/mapping/CSVLayerExtension.js +1 -1
- package/mapping/ElevationLayerExtension.js +1 -1
- package/mapping/FeatureCollectionLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtensionBase.js +1 -1
- package/mapping/GeoRSSLayerExtension.js +1 -1
- package/mapping/GraphicsLayerExtension.js +1 -1
- package/mapping/GroundExtension.d.ts +1 -1
- package/mapping/GroundExtension.js +1 -1
- package/mapping/GroupLayerExtension.js +1 -1
- package/mapping/ImageryLayerExtension.js +1 -1
- package/mapping/ImageryTileLayerExtension.js +1 -1
- package/mapping/IntegratedMeshLayerExtension.js +1 -1
- package/mapping/KMLLayerExtension.js +1 -1
- package/mapping/KMLSublayerExtension.js +1 -1
- package/mapping/LayerExtension.js +1 -1
- package/mapping/MapConstraints.js +1 -1
- package/mapping/MapExtension.d.ts +5 -5
- package/mapping/MapExtension.js +1 -1
- package/mapping/MapImageLayerExtension.d.ts +1 -1
- package/mapping/MapImageLayerExtension.js +1 -1
- package/mapping/MapImageSublayerExtension.js +1 -1
- package/mapping/OpenStreetMapLayerExtension.js +1 -1
- package/mapping/PointCloudLayerExtension.js +1 -1
- package/mapping/SceneLayerExtension.js +1 -1
- package/mapping/StreamLayerExtension.js +1 -1
- package/mapping/SublayerExtension.js +1 -1
- package/mapping/SubtypeGroupLayerExtension.js +1 -1
- package/mapping/SubtypeSublayerExtension.js +1 -1
- package/mapping/TileLayerExtension.js +1 -1
- package/mapping/TileSublayerExtension.js +1 -1
- package/mapping/UnsupportedLayerExtension.js +1 -1
- package/mapping/VectorTileLayerExtension.js +1 -1
- package/mapping/WMSLayerExtension.js +1 -1
- package/mapping/WMSSublayerExtension.js +1 -1
- package/mapping/WMTSLayerExtension.js +1 -1
- package/mapping/WMTSSublayerExtension.js +1 -1
- package/mapping/WebTileLayerExtension.js +1 -1
- package/mapping/_LayerExtension.d.ts +1 -1
- package/mapping/_LayerExtension.js +1 -1
- package/mapping/_SublayerExtension.d.ts +1 -1
- package/mapping/_SublayerExtension.js +1 -1
- package/mapping/convert.js +1 -1
- package/mapping/support/ArrayWrappedCollection.js +1 -1
- package/mapping/support/DefaultLayerExtensionFactory.js +1 -1
- package/mapping/support/DefaultSublayerExtensionFactory.js +1 -1
- package/mapping/support/LayerListSettings.js +1 -1
- package/mapping/support/PopupTemplateFeatureSettings.js +1 -1
- package/mapping/support/WfsCapabilities.js +1 -1
- package/mapping/support/WfsFeatureType.js +1 -1
- package/mapping/support/_LayerExtensionCollection.js +1 -1
- package/mapping/support/_SublayerExtensionCollection.js +1 -1
- package/mapping/support/_kml.js +1 -1
- package/mapping/support/ogc.js +1 -1
- package/menus/Menu.js +1 -1
- package/menus/MenuItem.js +1 -1
- package/package.json +36 -35
- package/portal/ApplicationProperties.d.ts +16 -13
- package/portal/Background.d.ts +3 -2
- package/portal/Background.js +1 -1
- package/portal/BaseMap.d.ts +1 -0
- package/portal/BaseMap.js +1 -1
- package/portal/BaseMapLayer.d.ts +3 -2
- package/portal/BingLayer.d.ts +1 -0
- package/portal/Bookmark.d.ts +1 -0
- package/portal/BuildingSceneLayer.d.ts +1 -1
- package/portal/BuildingSceneLayer.js +1 -1
- package/portal/BuildingSceneSublayer.js +1 -1
- package/portal/CIMSymbol.d.ts +1 -0
- package/portal/CSVLayer.d.ts +1 -0
- package/portal/CSVLayer.js +1 -1
- package/portal/Camera.d.ts +1 -0
- package/portal/Camera.js +1 -1
- package/portal/ClassBreaksRenderer.d.ts +4 -2
- package/portal/CodedValueDomain.d.ts +2 -2
- package/portal/CodedValueDomain.js +1 -1
- package/portal/ColorClassBreakInfo.d.ts +1 -0
- package/portal/ColorUniqueValueInfos.d.ts +1 -0
- package/portal/DataSource.d.ts +5 -4
- package/portal/DefinitionEditor.d.ts +3 -2
- package/portal/Domain.d.ts +3 -2
- package/portal/Domain.js +1 -1
- package/portal/DrawingInfo.d.ts +1 -0
- package/portal/DrawingInfo.js +1 -1
- package/portal/DynamicDataLayer.d.ts +2 -2
- package/portal/DynamicMapLayer.d.ts +1 -1
- package/portal/Edges.d.ts +1 -1
- package/portal/Edges.js +1 -1
- package/portal/Effect.d.ts +2 -2
- package/portal/ElevationInfo.d.ts +2 -2
- package/portal/ElevationInfo.js +1 -1
- package/portal/ElevationLayer.d.ts +1 -0
- package/portal/ElevationLayer.js +1 -1
- package/portal/Environment.d.ts +1 -0
- package/portal/Environment.js +1 -1
- package/portal/Extent.d.ts +1 -1
- package/portal/ExtrudeSymbol3DLayer.d.ts +1 -0
- package/portal/Feature.d.ts +1 -0
- package/portal/Feature.js +1 -1
- package/portal/FeatureCollection.d.ts +1 -0
- package/portal/FeatureLayer.d.ts +2 -1
- package/portal/FeatureLayer.js +1 -1
- package/portal/FeatureReduction.d.ts +1 -1
- package/portal/FeatureReduction.js +1 -1
- package/portal/FeatureSet.d.ts +1 -0
- package/portal/Field.d.ts +2 -2
- package/portal/Field.js +1 -1
- package/portal/FieldInfo.d.ts +2 -1
- package/portal/FillSymbol3DLayer.d.ts +1 -0
- package/portal/FormInfo.d.ts +13 -13
- package/portal/FormInfo.js +1 -1
- package/portal/Format.d.ts +2 -1
- package/portal/GeoRSSLayer.d.ts +1 -0
- package/portal/GeoRSSLayer.js +1 -1
- package/portal/Geometry.d.ts +3 -3
- package/portal/Geometry.js +1 -1
- package/portal/Ground.d.ts +1 -1
- package/portal/Ground.js +1 -1
- package/portal/GroupLayer.d.ts +2 -1
- package/portal/GroupLayer.js +1 -1
- package/portal/HeatmapRenderer.d.ts +2 -0
- package/portal/IconSymbol3DLayer.d.ts +1 -0
- package/portal/ImageServiceLayer.d.ts +1 -0
- package/portal/ImageServiceLayer.js +1 -1
- package/portal/ImageServiceVectorLayer.d.ts +1 -0
- package/portal/InheritedDomain.d.ts +1 -1
- package/portal/InheritedDomain.js +1 -1
- package/portal/InitialState.d.ts +1 -0
- package/portal/InitialState.js +1 -1
- package/portal/IntegratedMeshLayer.d.ts +1 -0
- package/portal/IntegratedMeshLayer.js +1 -1
- package/portal/Item.d.ts +2 -1
- package/portal/Item.js +1 -1
- package/portal/JoinTableDataSource.d.ts +2 -2
- package/portal/KMLLayer.d.ts +1 -0
- package/portal/KMLLayer.js +1 -1
- package/portal/LabelSymbol3D.d.ts +1 -0
- package/portal/LabelingInfo.d.ts +3 -2
- package/portal/LabelingInfo.js +1 -1
- package/portal/Layer.d.ts +1 -1
- package/portal/Layer.js +1 -1
- package/portal/LayerBase.js +1 -1
- package/portal/LayerDefinition.d.ts +8 -7
- package/portal/LayerDefinition.js +1 -1
- package/portal/Lighting.d.ts +3 -1
- package/portal/Lighting.js +1 -1
- package/portal/LineSymbol3D.d.ts +1 -0
- package/portal/LineSymbol3DLayer.d.ts +1 -0
- package/portal/LocationInfo.d.ts +1 -0
- package/portal/MapFloorInfo.d.ts +4 -4
- package/portal/MapFloorInfo.js +1 -1
- package/portal/MapRangeInfo.d.ts +1 -0
- package/portal/MapServiceLayer.d.ts +1 -0
- package/portal/MapServiceLayer.js +1 -1
- package/portal/MediaInfo.d.ts +1 -1
- package/portal/MediaInfo.js +1 -1
- package/portal/MeshSymbol3D.d.ts +1 -0
- package/portal/MosaicRule.d.ts +3 -2
- package/portal/MosaicRule.js +1 -1
- package/portal/Multipoint.d.ts +1 -1
- package/portal/ObjectSymbol3DLayer.d.ts +1 -0
- package/portal/OpenStreetMapLayer.d.ts +1 -0
- package/portal/OpenStreetMapLayer.js +1 -1
- package/portal/OperationalLayer.d.ts +3 -3
- package/portal/PathSymbol3DLayer.d.ts +1 -0
- package/portal/PictureFillSymbol.d.ts +1 -0
- package/portal/PictureMarkerSymbol.d.ts +1 -0
- package/portal/Point.d.ts +2 -1
- package/portal/PointCloudBitfieldFilter.d.ts +1 -0
- package/portal/PointCloudClassBreaksRenderer.d.ts +1 -0
- package/portal/PointCloudFilter.d.ts +2 -1
- package/portal/PointCloudFixedSizeAlgorithm.d.ts +1 -0
- package/portal/PointCloudLayer.d.ts +1 -0
- package/portal/PointCloudLayer.js +1 -1
- package/portal/PointCloudRGBRenderer.d.ts +1 -0
- package/portal/PointCloudRenderer.d.ts +3 -1
- package/portal/PointCloudRenderer.js +1 -1
- package/portal/PointCloudReturnFilter.d.ts +1 -0
- package/portal/PointCloudSplatAlgorithm.d.ts +1 -0
- package/portal/PointCloudStretchRenderer.d.ts +1 -0
- package/portal/PointCloudUniqueValueRenderer.d.ts +1 -0
- package/portal/PointCloudValueFilter.d.ts +1 -0
- package/portal/PointSymbol3D.d.ts +2 -1
- package/portal/Polygon.d.ts +1 -1
- package/portal/PolygonSymbol3D.d.ts +1 -0
- package/portal/Polyline.d.ts +1 -1
- package/portal/PopupExpressionInfo.d.ts +2 -1
- package/portal/PopupInfo.d.ts +3 -1
- package/portal/PopupInfo.js +1 -1
- package/portal/PredominanceRenderer.d.ts +1 -0
- package/portal/Presentation.d.ts +1 -0
- package/portal/Presentation.js +1 -1
- package/portal/QueryTableDataSource.d.ts +1 -1
- package/portal/RangeDomain.d.ts +1 -1
- package/portal/RangeDomain.js +1 -1
- package/portal/RangeInfo.d.ts +1 -0
- package/portal/RasterDataSource.d.ts +1 -1
- package/portal/Renderer.d.ts +8 -6
- package/portal/Renderer.js +1 -1
- package/portal/RenderingRule.d.ts +3 -2
- package/portal/RenderingRule.js +1 -1
- package/portal/SceneLayer.d.ts +1 -0
- package/portal/SceneLayer.js +1 -1
- package/portal/SimpleFillSymbol.d.ts +2 -1
- package/portal/SimpleLineSymbol.d.ts +2 -1
- package/portal/SimpleMarkerSymbol.d.ts +2 -1
- package/portal/SimpleRenderer.d.ts +1 -0
- package/portal/Slide.d.ts +4 -4
- package/portal/Slide.js +1 -1
- package/portal/SpatialReference.d.ts +1 -0
- package/portal/SpatialReference.js +1 -1
- package/portal/StreamLayer.d.ts +1 -1
- package/portal/StreamLayer.js +1 -1
- package/portal/StyleSymbolReference.d.ts +1 -0
- package/portal/SubtypeGroupLayer.d.ts +3 -2
- package/portal/SubtypeGroupLayer.js +1 -1
- package/portal/SubtypeSublayer.d.ts +1 -0
- package/portal/SubtypeSublayer.js +1 -1
- package/portal/Symbol.d.ts +11 -11
- package/portal/Symbol.js +1 -1
- package/portal/Symbol3D.d.ts +7 -2
- package/portal/Table.d.ts +3 -3
- package/portal/Table.js +1 -1
- package/portal/TableDataSource.d.ts +1 -1
- package/portal/Template.d.ts +2 -1
- package/portal/Template.js +1 -1
- package/portal/TemporalRenderer.d.ts +1 -0
- package/portal/TextSymbol.d.ts +1 -0
- package/portal/TextSymbol3DLayer.d.ts +1 -0
- package/portal/TileInfo.d.ts +2 -1
- package/portal/TileInfo.js +1 -1
- package/portal/TiledImageServiceLayer.d.ts +1 -0
- package/portal/TiledImageServiceLayer.js +1 -1
- package/portal/TiledMapServiceLayer.d.ts +2 -1
- package/portal/TiledMapServiceLayer.js +1 -1
- package/portal/Type.d.ts +2 -4
- package/portal/Type.js +1 -1
- package/portal/UniqueValueFromStyle.d.ts +1 -0
- package/portal/UniqueValueRenderer.d.ts +2 -0
- package/portal/UtilityNetwork.d.ts +2 -2
- package/portal/UtilityNetwork.js +1 -1
- package/portal/Value.d.ts +1 -1
- package/portal/VectorFieldRenderer.d.ts +1 -1
- package/portal/VectorTileLayer.d.ts +1 -0
- package/portal/VectorTileLayer.js +1 -1
- package/portal/VerticalOffset.d.ts +1 -1
- package/portal/Viewpoint.d.ts +1 -0
- package/portal/Viewpoint.js +1 -1
- package/portal/VisualVariable.d.ts +10 -4
- package/portal/WMSLayer.d.ts +1 -0
- package/portal/WMSLayer.js +1 -1
- package/portal/WMSSublayer.d.ts +1 -0
- package/portal/WMSSublayer.js +1 -1
- package/portal/WMTSInfo.d.ts +1 -1
- package/portal/WMTSInfo.js +1 -1
- package/portal/Weather.d.ts +6 -1
- package/portal/Weather.js +1 -1
- package/portal/WebMap.d.ts +3 -3
- package/portal/WebMap.js +1 -1
- package/portal/WebScene.d.ts +3 -1
- package/portal/WebScene.js +1 -1
- package/portal/WebSceneBaseMap.d.ts +1 -0
- package/portal/WebSceneBaseMap.js +1 -1
- package/portal/WebTileLayer.d.ts +1 -0
- package/portal/WebTileLayer.js +1 -1
- package/portal/Widgets.d.ts +6 -4
- package/portal/Widgets.js +1 -1
- package/portal/_LayerBase.d.ts +2 -2
- package/portal/_layerHelper.js +1 -1
- package/portal/_utils.js +1 -1
- package/support/Action.d.ts +4 -4
- package/support/ArcGISRequestHelper.js +1 -1
- package/support/Cancellable.d.ts +1 -1
- package/support/Cancellable.js +1 -1
- package/support/FormatSettings.js +1 -1
- package/support/InitializableBase.d.ts +1 -1
- package/support/InitializableBase.js +1 -1
- package/support/InitializableCollectionProxy.js +1 -1
- package/support/InitializeError.js +1 -1
- package/support/Observable.js +1 -1
- package/support/ReadOnlyInitializableCollection.js +1 -1
- package/support/Serializable.d.ts +4 -4
- package/support/Serializable.js +1 -1
- package/support/Settings.js +1 -1
- package/support/_ArcGISRelationshipCollection.js +1 -1
- package/support/_esriInternal.js +1 -1
- package/support/_graphicsQuery.js +1 -1
- package/support/_query.js +1 -1
- package/support/_requestCache.js +1 -1
- package/support/_restApiJson.d.ts +1 -1
- package/support/esri.d.ts +76 -76
- package/support/esri.js +1 -1
- package/tasks/geocoding/ArcGISGeocoder.js +1 -1
- package/tasks/geocoding/Geocoder.d.ts +1 -1
- package/tasks/geocoding/Geocoder.js +1 -1
- package/tasks/geocoding/utilities.js +1 -1
- package/tasks/identify/ArcGISSublayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/BuildingComponentSublayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/BuildingComponentSublayerHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/CSVLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/ClientSideIdentifyProvider.d.ts +2 -2
- package/tasks/identify/ClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/GeoRSSLayerIdentifyProvider.js +1 -1
- package/tasks/identify/GraphicsLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/HitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/HitTestIdentifyProvider.js +1 -1
- package/tasks/identify/IdentifyError.js +1 -1
- package/tasks/identify/IdentifyProviderBase.js +1 -1
- package/tasks/identify/IdentifyService.js +1 -1
- package/tasks/identify/ImageryLayerIdentifyProvider.js +1 -1
- package/tasks/identify/KMLLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/PointCloudLayerHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/SceneLayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/SceneLayerHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/SceneLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/StreamLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/StreamLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/SubtypeSublayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/SubtypeSublayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/WMSSublayerIdentifyProvider.js +1 -1
- package/tasks/query/ArcGISRelationship.js +1 -1
- package/tasks/query/ArcGISServiceTableQueryProvider.js +1 -1
- package/tasks/query/ArcGISSublayerQueryProvider.js +1 -1
- package/tasks/query/BuildingComponentSublayerClientSideQueryProvider.js +1 -1
- package/tasks/query/CSVLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/CSVLayerQueryProvider.js +1 -1
- package/tasks/query/ClientSideQueryProvider.d.ts +2 -2
- package/tasks/query/ClientSideQueryProvider.js +1 -1
- package/tasks/query/FeatureLayerQueryProvider.js +1 -1
- package/tasks/query/GeoRSSLayerQueryProvider.js +1 -1
- package/tasks/query/GraphicsLayerQueryProvider.js +1 -1
- package/tasks/query/ImageryLayerQueryProvider.js +1 -1
- package/tasks/query/KMLLayerQueryProvider.js +1 -1
- package/tasks/query/QueryBasedRelationship.js +1 -1
- package/tasks/query/QueryError.js +1 -1
- package/tasks/query/QueryProviderBase.js +1 -1
- package/tasks/query/QueryService.js +1 -1
- package/tasks/query/SceneLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/SceneLayerQueryProvider.js +1 -1
- package/tasks/query/StreamLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/StreamLayerQueryProvider.js +1 -1
- package/tasks/query/SubtypeSublayerQueryProvider.js +1 -1
- package/tasks/search/ArcGISGeocoderSearchProvider.js +1 -1
- package/tasks/search/GeocoderSearchProvider.js +1 -1
- package/tasks/search/QuerySearchProvider.js +1 -1
- package/tasks/search/SearchError.js +1 -1
- package/tasks/search/SearchProviderBase.js +1 -1
- package/tasks/search/SearchService.js +1 -1
- package/tasks/search/_utilities.js +1 -1
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/CopyOnWriteCollection.js +1 -1
- package/utilities/GeometryServiceError.js +1 -1
- package/utilities/MapTransformCollection.js +1 -1
- package/utilities/ObservableMap.js +1 -1
- package/utilities/ObservableSet.js +1 -1
- package/utilities/ObservableWeakSet.js +1 -1
- package/utilities/ReadOnlyCollection.js +1 -1
- package/utilities/ReadOnlyMap.js +1 -1
- package/utilities/_layers.js +1 -1
- package/utilities/_ogc.js +1 -1
- package/utilities/arcade.js +1 -1
- package/utilities/array.js +1 -1
- package/utilities/asyncIterable.d.ts +1 -1
- package/utilities/asyncIterable.js +1 -1
- package/utilities/basemaps.js +1 -1
- package/utilities/checkArg.js +1 -1
- package/utilities/collection.js +1 -1
- package/utilities/date.js +1 -1
- package/utilities/esri.js +1 -1
- package/utilities/extensions.js +1 -1
- package/utilities/geometry.d.ts +2 -2
- package/utilities/geometry.js +1 -1
- package/utilities/iterable.js +1 -1
- package/utilities/log.d.ts +1 -1
- package/utilities/log.js +1 -1
- package/utilities/mapping.js +1 -1
- package/utilities/math.js +1 -1
- package/utilities/number.js +1 -1
- package/utilities/object.js +1 -1
- package/utilities/portal.d.ts +3 -3
- package/utilities/portal.js +1 -1
- package/utilities/promise.d.ts +1 -1
- package/utilities/promise.js +1 -1
- package/utilities/query.js +1 -1
- package/utilities/relationships.js +1 -1
- package/utilities/scaleRanges.d.ts +1 -1
- package/utilities/set.js +1 -1
- package/utilities/string.d.ts +6 -21
- package/utilities/string.js +1 -1
- package/utilities/symbol.js +1 -1
- package/utilities/uri.js +1 -1
- package/utilities/watch.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{ArgumentError}from"../ArgumentError.js";import{InvalidOperationError}from"../InvalidOperationError.js";import{ItemType}from"../ItemType.js";import{FeatureSourceBase}from"../data/FeatureSourceBase.js";import{Schema}from"../data/Schema.js";import{LayerBase as PortalLayerBase}from"../portal/LayerBase.js";import{ERR_LAYER_TYPE_MISMATCH}from"../portal/_layerHelper.js";import{DefaultArcGISRequestHelper}from"../support/ArcGISRequestHelper.js";import{ReadOnlyInitializableCollection}from"../support/ReadOnlyInitializableCollection.js";import{serializable}from"../support/Serializable.js";import{isLayer}from"../utilities/_layers.js";import{checkArg}from"../utilities/checkArg.js";import{Collection,compare}from"../utilities/collection.js";import{load}from"../utilities/esri.js";import{isGroupLayerExtension}from"../utilities/extensions.js";import{hasMmapLayer}from"../utilities/layers.js";import{getLogger}from"../utilities/log.js";import{deepClone}from"../utilities/object.js";import{toPortalItem}from"../utilities/portal.js";import{onCollectionPropertyChange,watchEach}from"../utilities/watch.js";import{_assignSublayerExtensions}from"./_SublayerExtension.js";import{ExtensionBaseLayerListSettings,fromLayerListMode}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase}from"./support/_SublayerExtensionCollection.js";const ERR_INVALID_LAYER_TYPE="Invalid type of layer for this type of layer extension.",ERR_FEATURES_NOT_SUPPORTED="This type of layer does not have features.",ERR_ADD_SUBLAYERX_NOT_SUPPORTED="This type of layer cannot have sublayers.",DEFAULT_CAPABILITIES=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export class LayerExtension extends FeatureSourceBase{constructor(e){super(e),this._itemType=ItemType.LAYER_EXTENSION,this._watchHandles=[],this._dynamicallyAddedLayer=!1,this._visibilityMode="independent",this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){getLayerXLogger().error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._onVisibleChanged=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this._sublayers)for(const t of this._sublayers.toArray())t.visible=e;this.notifyChange("isEffectivelyVisible")},this._onSublayersSublayerVisibleChanged=(e,t,i,r)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(r)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t={...this.getDefaults(),...e};checkArg("properties.layer",t.layer).isNotMissing();const{layer:i}=t;let r;if(i?.hasOwnProperty("listMode")&&(r=fromLayerListMode(i.listMode)),this.layerListSettings=this._createLayerListSettings({...r,...t.layerListSettings}),isLayer(i))checkArg("properties.layer",i).satisfies((e=>this._isSupportedLayer(e)),ERR_INVALID_LAYER_TYPE),this._setLayer(i);else if(i){if(i.$portalItem){const e=i.$portalItem;this._portalItem=toPortalItem(e)}this._deferredLayerProperties=i}this._sublayerExtensions=this._createSublayerExtensionCollection(),this.allSublayerExtensions=new AllSublayerExtensionCollectionImpl(this),this.watch("parentLayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible"))),this.watch("layer.sublayers",(()=>this.notifyChange("_sublayers")))}get layer(){return this._layer}get mapExtension(){return this._mapExtension}get basemapExtension(){return this._basemapExtension}get groundExtension(){return this._groundExtension}get parentLayerExtension(){return this._parentLayerExtension}get hasFeatures(){return!1}get capabilities(){return this._capabilities()}get renderer(){}get visibilityMode(){return this._visibilityMode}set visibilityMode(e){this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get sublayerExtensions(){return this._sublayerExtensions}get requestHelper(){return this._requestHelper||(this._requestHelper=new DefaultArcGISRequestHelper),this._requestHelper}set requestHelper(e){this._requestHelper=e}get title(){return this.layer?.title??this._deferredLayerProperties?.title??("string"==typeof this._deferredLayerProperties?.$ref?this._deferredLayerProperties?.$ref:this._deferredLayerProperties?.$ref?.title??this._deferredLayerProperties?.$ref?.id)??"Layer"}get supportsSublayers(){return!1}get effectiveMinScale(){return this.layer&&this.layer.minScale||0}get effectiveMaxScale(){return this.layer&&this.layer.maxScale||0}get isEffectivelyVisible(){const e=!!this.layer&&this.layer.visible;return this.parentLayerExtension?this.parentLayerExtension.isEffectivelyVisible&&e:e}get effectiveFullExtent(){return this.layer?this.layer.fullExtent:void 0}get canChangeScale(){return!0}get canChangeOpacity(){return!0}get canChangeLabels(){return!1}get initialVisibility(){return this._initialVisibility??this.layer?.visible??!1}get _layerSupportsHideChildren(){return this.supportsSublayers}get _sublayers(){if(this.supportsSublayers)return this.layer?this.layer.sublayers:void 0}get dynamicallyAddedLayer(){return this._dynamicallyAddedLayer}set dynamicallyAddedLayer(e){this._dynamicallyAddedLayer=e}get sublayersAreReadOnly(){return!0}static create(e){if(!LayerExtension.factory)throw new InvalidOperationError("Cannot create layer extension: no layer extension factory has been registered.");return LayerExtension.factory.create(e)}static async fromPortalItem(e,t){checkArg("portalItemLike",e).isNotMissing();const i=t??{};checkArg("layerExtensionProperties.layer",i.layer).satisfies((e=>!isLayer(e)));const r={...i.layer};checkArg("layerExtensionProperties.layer.$ref",r.$ref).satisfies((e=>null==e));const s=new DefaultArcGISRequestHelper,a=toPortalItem(e);let n;await load(a);const o=a.typeKeywords??"";if("Map Service"===a.type)n=o.includes("Tiled")||o.includes("Hosted Service")?"ArcGISTiledMapServiceLayer":"ArcGISMapServiceLayer";else if("Feature Service"===a.type)n="ArcGISFeatureLayer";else if("Image Service"===a.type){const e=await LayerExtension._getLayerData(a.url,s);e.cacheType?"Map"===e.cacheType?n="ArcGISTiledImageServiceLayer":("Elevation"===e.cacheType||o.includes("Elevation 3D Layer"))&&(n="ArcGISTiledElevationServiceLayer"):n=e.singleFusedMapCache||e.tileInfo||o.includes("Hosted Service")?"ArcGISTiledImageServiceLayer":"ArcGISImageServiceLayer"}else if("CSV"===a.type)n="CSV";else if("KML"===a.type)n="KML";else if("Scene Service"===a.type)o.includes("3DObject")||o.includes("Point")?n="ArcGISSceneServiceLayer":o.includes("IntegratedMesh")?n="IntegratedMeshLayer":o.includes("PointCloud")?n="PointCloudLayer":o.includes("Building")&&(n="BuildingSceneLayer");else if("Stream Service"===a.type)n="ArcGISStreamLayer";else if("Vector Tile Service"===a.type)n="VectorTileLayer";else if("Feature Collection"===a.type){n="ArcGISFeatureLayer";const e=await a.fetchData();r.featureCollection=e}else if("WMTS"===a.type){n="WebTiledLayer";const e=await a.fetchData();Object.assign(r,e)}else if("WMS"===a.type){n="WMS";const e=await a.fetchData();Object.assign(r,e)}if(!n)throw new ArgumentError("portalItem","Could not determine correct type of LayerExtension to create from portal item");if(r.layerType&&r.layerType!==n)throw new ArgumentError("layerExtensionProperties.layer.layerType","Layer type defined in layer properties does not match layer type from portal item");return r.layerType=n,r.$portalItem=a,i.layer=r,LayerExtension.create(i)}static _matchesRef(e,t){if(!e||!t)return!1;const i=t.$ref;return"string"==typeof i?e.id===i||e.title===i:!!i&&(e.id===i.id||e.title===i.title&&!i.path)}static async _getLayerData(e,t){const i=await t.request(e,{query:{f:"json"}});if(!i||!i.data)throw new Error(`Response to request for url ${e} was invalid.`);return i.data}getFeatures(e,t){if(!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.addFeatures(e,t)}async updateFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.deleteFeatures(e,t)}async _createBackingLayer(){this._portalItem||this.layer||this._deferredLayerProperties&&this._deferredLayerProperties.$ref?!this.layer&&this._portalItem&&this._setLayer(await this._createLayer(this.getDefaults().layer)):(this._setLayer(await this._createLayer(this._deferredLayerProperties)),checkArg("properties.layer",this._layer).satisfies((e=>this._isSupportedLayer(e)),ERR_INVALID_LAYER_TYPE),this._deferredLayerProperties=void 0)}_setMapExtension(e){const t=this.mapExtension;this._mapExtension=e,t&&this.featureSettings.formatSettings.parent===t.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.formatSettings)),this._resolveLayer(),this.notifyChange("mapExtension")}_setBasemapExtension(e){this._basemapExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("basemapExtension")}_setGroundExtension(e){this._groundExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("groundExtension")}_setParentLayerExtension(e){const t=this._parentLayerExtension;this._parentLayerExtension=e,t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.mapExtension?this.mapExtension.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&((!this.featureSettings.formatSettings.parent||this.mapExtension&&this.featureSettings.formatSettings.parent===this.mapExtension.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings)),this._resolveLayer(),this.notifyChange("parentLayerExtension")}_resolveLayer(e){if(this.layer||!this._deferredLayerProperties)return;const t=e=>LayerExtension._matchesRef(e,this._deferredLayerProperties);let i;e?i=e.find(t):this.basemapExtension?.basemap?(i=this.basemapExtension.basemap.baseLayers.find(t),i=i||this.basemapExtension.basemap.referenceLayers.find(t)):this.groundExtension?.ground?i=this.groundExtension.ground.layers.find(t):this.parentLayerExtension?.layer?i=this.parentLayerExtension.layer.layers.find(t):this.mapExtension&&(i=this.mapExtension.map.layers.find(t)),i&&this._isSupportedLayer(i)&&(this._setLayer(i),this._originalRef=this._deferredLayerProperties.$ref,this._deferredLayerProperties.$portalItem&&getLayerXLogger().warn("LayerExtension defined with both $ref and $portalItem. Ignoring $portalItem."))}async _switchLayer(e){if(e===this.layer)return;checkArg("newLayer",e).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),ERR_INVALID_LAYER_TYPE),this.isInitialized&&await load(e);const t=new Map;if(this._sublayers)for(const e of this._sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));e.visible=this.layer.visible,e.opacity=this.layer.opacity,e.listMode=this.layer.listMode,e.hasOwnProperty("labelsVisible")&&this.layer.hasOwnProperty("labelsVisible")&&(e.labelsVisible=this.layer.labelsVisible),this._setLayer(e);const i=[];if(this._sublayers){const e=this._sublayers.filter((e=>t.has(e.id))).toArray();i.push(...e.map((async e=>{const i=t.get(e.id);await i._switchSublayer(e),this._sublayerExtensions._register(i)})))}this.isInitialized&&i.push(this._initializeChildren()),await Promise.all(i)}_getProjectWebmapJSON(){if(!this.layer)return;let e=PortalLayerBase.fromEsriApiLayer(this.layer);if(!this.dynamicallyAddedLayer){const{id:t,title:i,layerType:r,visibility:s,opacity:a}=e;e={id:t,title:i,layerType:r,visibility:s,opacity:a}}return e}async _onDestroy(){this._watchHandles.forEach((e=>e?.remove())),await Promise.all(this.sublayerExtensions.toArray().map((e=>e.destroy()))),await super._onDestroy()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconUrl:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.iconUrl:this.getDefault("iconUrl")},visibilityMode:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.visibilityMode:this.getDefault("visibilityMode"),default:"independent"},tpkSource:{serializeModes:["initial"]},layerListSettings:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.layerListSettings:this.getDefault("layerListSettings")},sublayerExtensions:{serializeModes:["initial","project"],serialize:e=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{_assignSublayerExtensions(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},layer:{serializeModes:["initial","project"],serialize:e=>{if(this.layer){if((this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension)&&(this._layer.id||this._layer.title)){const e=PortalLayerBase.getLayerType(this._layer),t=this._getSerializableRefLayerProperties();return{$ref:this._originalRef||{id:this._layer.id,title:this._layer.title,subtype:this._getSerializableLayerType()},layerType:e,...t}}return PortalLayerBase.fromEsriApiLayer(this.layer)}return this._deferredLayerProperties?deepClone(this._deferredLayerProperties):void 0},isDefault:()=>{throw new Error("Missing implementation for _getSerializableProperties() > layer > default. Subclasses of LayerExtension must implement this.")},deserialize:e=>{if(isLayer(e)){if(e!==this.layer)throw new Error("Property 'layer' is read-only.")}else e&&(this._layer?this._applyLayerProperties(e,this.layer):this._deferredLayerProperties&&(this._deferredLayerProperties={...this._deferredLayerProperties,...e}))}},dynamicallyAddedLayer:{serializeModes:["project"],default:!1},requestHelper:{serialize:!1}}}_getSerializableLayerType(){}_getSerializableRefLayerProperties(){return{}}_createSublayerExtension(e){if(!this.supportsSublayers)throw new InvalidOperationError(ERR_ADD_SUBLAYERX_NOT_SUPPORTED);throw new Error("Missing implementation for _createSublayerExtension(). Subclasses of LayerExtension that support sublayers must implement this.")}async _onInitialize(){if(await super._onInitialize(),await this._createBackingLayer(),this._portalItem&&(await load(this._portalItem),await this._applyPortalItemProperties(this._portalItem),this.layer.title=this._portalItem.title,this.layer.portalItem=this._portalItem,this.iconUrl||(this.iconUrl=this._portalItem.thumbnailUrl),await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),this._resolveLayer(),!this.layer){const e=this._deferredLayerProperties.$ref;throw this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension?new InvalidOperationError(`No layer found matching reference "${"string"==typeof e?e:JSON.stringify(e)}".`):new InvalidOperationError("Cannot resolve layer reference: missing parent.")}this._deferredLayerProperties&&(await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),await this._initializeLayer(),await load(this.layer),this.supportsSublayers&&!this.layer.sublayers&&this.layer._set("sublayers",new Collection),this._initialVisibility=this.layer.visible,this._sublayerExtensions.onParentInitialized()}async _postInitialize(){await super._postInitialize(),this.layerListSettings.onLayerExtensionInitialized(),this._watchHandles.push(onCollectionPropertyChange(this,"layer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}_applyPortalItemProperties(e){throw new InvalidOperationError("Cannot use this type of layer extension with a PortalItem.")}async _initializeLayer(){}_createLayerListSettings(e){return new LayerExtensionLayerListSettings(e,this)}_createSublayerExtensionCollection(){return new SublayerExtensionCollectionImpl(this)}_capabilities(){return DEFAULT_CAPABILITIES}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}async _createLayer(e){return PortalLayerBase.toEsriApiLayer(e)}_applyLayerProperties(e,t){checkArg("layerJson",e).isNotMissing();const i=e.layerType||e.type;return checkArg("layerJson.layerType",i).satisfies((e=>!e||e===this.getDefault("layer")?.layerType),ERR_LAYER_TYPE_MISMATCH),checkArg("layer",t).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),ERR_LAYER_TYPE_MISMATCH),PortalLayerBase.applyToEsriApiLayer(e,t)}_setLayer(e){if(this._layer=e,e.watch("visible",this._onVisibleChanged),this.layer.watch("minScale",(()=>this.notifyChange("effectiveMinScale"))),this.layer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layer.watch("title",(()=>this.notifyChange("title"))),this.supportsSublayers)if(this._sublayers)this._setupSublayersHandles();else{const t=e.watch("sublayers",(()=>{this._setupSublayersHandles(),t.remove()}),!0)}this.notifyChange("layer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_setupSublayersHandles(){this._sublayers.on("change",this._onSublayersChange),watchEach(this._sublayers,"visible",this._onSublayersSublayerVisibleChanged)}_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.layer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}class SublayerExtensionCollectionImpl extends SublayerExtensionCollectionBase{constructor(e){super(e,"_sublayers"),this._layerExtension=e}add(e,t){if(checkArg("sublayerX",e).isNotMissing(),!this._layerExtension.supportsSublayers)throw new InvalidOperationError(ERR_ADD_SUBLAYERX_NOT_SUPPORTED);const i=e.sublayer?e.sublayer.layer:void 0;return i&&i!==this._layerExtension.layer&&i.sublayers.remove(e.sublayer),super.add(e,t)}}class AllSublayerExtensionCollectionImpl extends ReadOnlyInitializableCollection{constructor(e){super(),this._layerExtension=e}get _collection(){return this._layerExtension.sublayerExtensions.flatten((e=>e.sublayerExtensions))}findById(e){return checkArg("id",e).isNotMissing(),this.find((t=>t.id===e))}findBySublayerId(e){return checkArg("id",e).isNotMissing(),this.find((t=>t.sublayer.id===e))}forSublayer(e){return checkArg("sublayer",e).isNotMissing(),this.findBySublayerId(e.id)}emit(e,t){if("change"===e){const i=new Collection;i.addMany(t.added);const r=i.flatten((e=>e.sublayerExtensions)).toArray(),s=new Collection;s.addMany(t.removed);const a=s.flatten((e=>e.sublayerExtensions)).toArray(),n=new Collection;n.addMany(t.moved);const o=n.flatten((e=>e.sublayerExtensions)).toArray();return super.emit(e,{added:r,removed:a,moved:o,target:this})}return super.emit(e,t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}}let LayerExtensionLayerListSettings=class extends ExtensionBaseLayerListSettings{get _esriLayer(){return this._extension.layer}get _listModePath(){return"layer.listMode"}get _supportsChildren(){return this._extension.supportsSublayers}};LayerExtensionLayerListSettings=__decorate([serializable],LayerExtensionLayerListSettings);export{LayerExtensionLayerListSettings};let LayerExtensionSchema=class extends Schema{constructor(e){if(super(),this._layerBindings=new Map,this._layerExtension=e,this._bindSettingsToLayerProperties(),e.layer)this._onLayerResolved(e.layer);else{const t=e.watch("layer",(()=>{this._onLayerResolved(e.layer),t.remove()}),!0)}}_getPropertyBindings(){return{}}_getSetting(e,t){if(this._layerBindings.has(e)){let t=this._layerBindings.get(e);if("string"==typeof t&&(t={property:t}),t.hasOwnProperty("value"))return t.value;if(this._layerExtension.layer)return this._layerExtension.layer[t.property]}return super._getSetting(e,t)}_setSetting(e,t){if(this._layerBindings.has(e)){let i=this._layerBindings.get(e);if("string"==typeof i&&(i={property:i}),i.readonly||i.hasOwnProperty("value"))throw new InvalidOperationError(ERR_SCHEMA_READ_ONLY);if(this._layerExtension.layer)return void(this._layerExtension.layer[i.property]=t)}super._setSetting(e,t)}_bindSettingsToLayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._layerBindings.set(t,i),i.hasOwnProperty("value")||this._layerExtension.watch(`layer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}_onLayerResolved(e){for(const t of this._layerBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}};LayerExtensionSchema=__decorate([serializable],LayerExtensionSchema);export{LayerExtensionSchema};export function _assignLayerExtensions(e,t){return compare(e,t,{onNew:(t,i)=>{e.add(t instanceof LayerExtension?t:LayerExtension.create(t),isLayerRef(t)?void 0:i)},onMatch:(t,i,r,s)=>{i instanceof LayerExtension||t.assignProperties(i),r===s||isLayerRef(i)||e.reorder(t,s)},onMissing:t=>{(hasMmapLayer([t])||isGroupLayerExtension(t)&&0===t.layerExtensions.toArray().length)&&e.remove(t)},equals:(e,t)=>t instanceof LayerExtension?t===e:!!LayerExtension._matchesRef(e.layer,t.layer)||e.id===t.id})}function getLayerXLogger(){return getLogger("geocortex.api.mapping.LayerExtension")}function isLayerRef(e){return e instanceof LayerExtension?!!e._deferredLayerProperties?.$ref:!isLayer(e.layer)&&!!e.layer?.$ref}let LayerExtensionReadOnlySchema=class extends LayerExtensionSchema{_setSetting(e,t){if(this._layerBindings.has(e))throw new InvalidOperationError(ERR_SCHEMA_READ_ONLY);super._setSetting(e,t)}};LayerExtensionReadOnlySchema=__decorate([serializable],LayerExtensionReadOnlySchema);export{LayerExtensionReadOnlySchema};export const ERR_SCHEMA_READ_ONLY="This schema property is read-only.";
|
|
1
|
+
import{__decorate as e}from"tslib";import{ArgumentError as t}from"../ArgumentError.js";import{InvalidOperationError as i}from"../InvalidOperationError.js";import{ItemType as s}from"../ItemType.js";import{FeatureSourceBase as r}from"../data/FeatureSourceBase.js";import{Schema as a}from"../data/Schema.js";import{LayerBase as n}from"../portal/LayerBase.js";import{ERR_LAYER_TYPE_MISMATCH as o}from"../portal/_layerHelper.js";import{DefaultArcGISRequestHelper as l}from"../support/ArcGISRequestHelper.js";import{ReadOnlyInitializableCollection as y}from"../support/ReadOnlyInitializableCollection.js";import{serializable as h}from"../support/Serializable.js";import{isLayer as p}from"../utilities/_layers.js";import{checkArg as d}from"../utilities/checkArg.js";import{Collection as u,compare as f}from"../utilities/collection.js";import{load as c}from"../utilities/esri.js";import{isGroupLayerExtension as _}from"../utilities/extensions.js";import{hasMmapLayer as g}from"../utilities/layers.js";import{getLogger as m}from"../utilities/log.js";import{deepClone as b}from"../utilities/object.js";import{toPortalItem as S}from"../utilities/portal.js";import{onCollectionPropertyChange as L,watchEach as E}from"../utilities/watch.js";import{_assignSublayerExtensions as x}from"./_SublayerExtension.js";import{ExtensionBaseLayerListSettings as w,fromLayerListMode as v}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase as M}from"./support/_SublayerExtensionCollection.js";const P="Invalid type of layer for this type of layer extension.",I="This type of layer does not have features.",C="This type of layer cannot have sublayers.",A=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export class LayerExtension extends r{get layer(){return this._layer}get mapExtension(){return this._mapExtension}get basemapExtension(){return this._basemapExtension}get groundExtension(){return this._groundExtension}get parentLayerExtension(){return this._parentLayerExtension}get hasFeatures(){return!1}get capabilities(){return this._capabilities()}get renderer(){}get visibilityMode(){return this._visibilityMode}set visibilityMode(e){this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get sublayerExtensions(){return this._sublayerExtensions}get requestHelper(){return this._requestHelper||(this._requestHelper=new l),this._requestHelper}set requestHelper(e){this._requestHelper=e}get title(){return this.layer?.title??this._deferredLayerProperties?.title??("string"==typeof this._deferredLayerProperties?.$ref?this._deferredLayerProperties?.$ref:this._deferredLayerProperties?.$ref?.title??this._deferredLayerProperties?.$ref?.id)??"Layer"}get supportsSublayers(){return!1}get effectiveMinScale(){return this.layer&&this.layer.minScale||0}get effectiveMaxScale(){return this.layer&&this.layer.maxScale||0}get isEffectivelyVisible(){const e=!!this.layer&&this.layer.visible;return this.parentLayerExtension?this.parentLayerExtension.isEffectivelyVisible&&e:e}get effectiveFullExtent(){return this.layer?this.layer.fullExtent:void 0}get canChangeScale(){return!0}get canChangeOpacity(){return!0}get canChangeLabels(){return!1}get initialVisibility(){return this._initialVisibility??this.layer?.visible??!1}get _layerSupportsHideChildren(){return this.supportsSublayers}get _sublayers(){if(this.supportsSublayers)return this.layer?this.layer.sublayers:void 0}get dynamicallyAddedLayer(){return this._dynamicallyAddedLayer}set dynamicallyAddedLayer(e){this._dynamicallyAddedLayer=e}get sublayersAreReadOnly(){return!0}constructor(e){super(e),this._itemType=s.LAYER_EXTENSION,this._watchHandles=[],this._dynamicallyAddedLayer=!1,this._visibilityMode="independent",this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){O().error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._onVisibleChanged=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this._sublayers)for(const t of this._sublayers.toArray())t.visible=e;this.notifyChange("isEffectivelyVisible")},this._onSublayersSublayerVisibleChanged=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t={...this.getDefaults(),...e};d("properties.layer",t.layer).isNotMissing();const{layer:i}=t;let r;if(i?.hasOwnProperty("listMode")&&(r=v(i.listMode)),this.layerListSettings=this._createLayerListSettings({...r,...t.layerListSettings}),p(i))d("properties.layer",i).satisfies((e=>this._isSupportedLayer(e)),P),this._setLayer(i);else if(i){if(i.$portalItem){const e=i.$portalItem;this._portalItem=S(e)}this._deferredLayerProperties=i}this._sublayerExtensions=this._createSublayerExtensionCollection(),this.allSublayerExtensions=new j(this),this.watch("parentLayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible"))),this.watch("layer.sublayers",(()=>this.notifyChange("_sublayers")))}static create(e){if(!LayerExtension.factory)throw new i("Cannot create layer extension: no layer extension factory has been registered.");return LayerExtension.factory.create(e)}static async fromPortalItem(e,i){d("portalItemLike",e).isNotMissing();const s=i??{};d("layerExtensionProperties.layer",s.layer).satisfies((e=>!p(e)));const r={...s.layer};d("layerExtensionProperties.layer.$ref",r.$ref).satisfies((e=>null==e));const a=new l,n=S(e);let o;await c(n);const y=n.typeKeywords??"";if("Map Service"===n.type)o=y.includes("Tiled")||y.includes("Hosted Service")?"ArcGISTiledMapServiceLayer":"ArcGISMapServiceLayer";else if("Feature Service"===n.type)o="ArcGISFeatureLayer";else if("Image Service"===n.type){const e=await LayerExtension._getLayerData(n.url,a);e.cacheType?"Map"===e.cacheType?o="ArcGISTiledImageServiceLayer":("Elevation"===e.cacheType||y.includes("Elevation 3D Layer"))&&(o="ArcGISTiledElevationServiceLayer"):o=e.singleFusedMapCache||e.tileInfo||y.includes("Hosted Service")?"ArcGISTiledImageServiceLayer":"ArcGISImageServiceLayer"}else if("CSV"===n.type)o="CSV";else if("KML"===n.type)o="KML";else if("Scene Service"===n.type)y.includes("3DObject")||y.includes("Point")?o="ArcGISSceneServiceLayer":y.includes("IntegratedMesh")?o="IntegratedMeshLayer":y.includes("PointCloud")?o="PointCloudLayer":y.includes("Building")&&(o="BuildingSceneLayer");else if("Stream Service"===n.type)o="ArcGISStreamLayer";else if("Vector Tile Service"===n.type)o="VectorTileLayer";else if("Feature Collection"===n.type){o="ArcGISFeatureLayer";const e=await n.fetchData();r.featureCollection=e}else if("WMTS"===n.type){o="WebTiledLayer";const e=await n.fetchData();Object.assign(r,e)}else if("WMS"===n.type){o="WMS";const e=await n.fetchData();Object.assign(r,e)}if(!o)throw new t("portalItem","Could not determine correct type of LayerExtension to create from portal item");if(r.layerType&&r.layerType!==o)throw new t("layerExtensionProperties.layer.layerType","Layer type defined in layer properties does not match layer type from portal item");return r.layerType=o,r.$portalItem=n,s.layer=r,LayerExtension.create(s)}static _matchesRef(e,t){if(!e||!t)return!1;const i=t.$ref;return"string"==typeof i?e.id===i||e.title===i:!!i&&(e.id===i.id||e.title===i.title&&!i.path)}static async _getLayerData(e,t){const i=await t.request(e,{query:{f:"json"}});if(!i?.data)throw new Error(`Response to request for url ${e} was invalid.`);return i.data}getFeatures(e,t){if(!this.hasFeatures)throw new i(I);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new i(I);await super.addFeatures(e,t)}async updateFeatures(e,t){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new i(I);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new i(I);await super.deleteFeatures(e,t)}async _createBackingLayer(){this._portalItem||this.layer||this._deferredLayerProperties?.$ref?!this.layer&&this._portalItem&&this._setLayer(await this._createLayer(this.getDefaults().layer)):(this._setLayer(await this._createLayer(this._deferredLayerProperties)),d("properties.layer",this._layer).satisfies((e=>this._isSupportedLayer(e)),P),this._deferredLayerProperties=void 0)}_setMapExtension(e){const t=this.mapExtension;this._mapExtension=e,t&&this.featureSettings.formatSettings.parent===t.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.formatSettings)),this._resolveLayer(),this.notifyChange("mapExtension")}_setBasemapExtension(e){this._basemapExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("basemapExtension")}_setGroundExtension(e){this._groundExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("groundExtension")}_setParentLayerExtension(e){const t=this._parentLayerExtension;this._parentLayerExtension=e,t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.mapExtension?this.mapExtension.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&((!this.featureSettings.formatSettings.parent||this.mapExtension&&this.featureSettings.formatSettings.parent===this.mapExtension.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings)),this._resolveLayer(),this.notifyChange("parentLayerExtension")}_resolveLayer(e){if(this.layer||!this._deferredLayerProperties)return;const t=e=>LayerExtension._matchesRef(e,this._deferredLayerProperties);let i;e?i=e.find(t):this.basemapExtension?.basemap?(i=this.basemapExtension.basemap.baseLayers.find(t),i=i||this.basemapExtension.basemap.referenceLayers.find(t)):this.groundExtension?.ground?i=this.groundExtension.ground.layers.find(t):this.parentLayerExtension?.layer?i=this.parentLayerExtension.layer.layers.find(t):this.mapExtension&&(i=this.mapExtension.map.layers.find(t)),i&&this._isSupportedLayer(i)&&(this._setLayer(i),this._originalRef=this._deferredLayerProperties.$ref,this._deferredLayerProperties.$portalItem&&O().warn("LayerExtension defined with both $ref and $portalItem. Ignoring $portalItem."))}async _switchLayer(e){if(e===this.layer)return;d("newLayer",e).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),P),this.isInitialized&&await c(e);const t=new Map;if(this._sublayers)for(const e of this._sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));e.visible=this.layer.visible,e.opacity=this.layer.opacity,e.listMode=this.layer.listMode,e.hasOwnProperty("labelsVisible")&&this.layer.hasOwnProperty("labelsVisible")&&(e.labelsVisible=this.layer.labelsVisible),this._setLayer(e);const i=[];if(this._sublayers){const e=this._sublayers.filter((e=>t.has(e.id))).toArray();i.push(...e.map((async e=>{const i=t.get(e.id);await i._switchSublayer(e),this._sublayerExtensions._register(i)})))}this.isInitialized&&i.push(this._initializeChildren()),await Promise.all(i)}_getProjectWebmapJSON(){if(!this.layer)return;let e=n.fromEsriApiLayer(this.layer);if(!this.dynamicallyAddedLayer){const{id:t,title:i,layerType:s,visibility:r,opacity:a}=e;e={id:t,title:i,layerType:s,visibility:r,opacity:a}}return e}async _onDestroy(){this._watchHandles.forEach((e=>e?.remove())),await Promise.all(this.sublayerExtensions.toArray().map((e=>e.destroy()))),await super._onDestroy()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconUrl:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.iconUrl:this.getDefault("iconUrl")},visibilityMode:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.visibilityMode:this.getDefault("visibilityMode"),default:"independent"},tpkSource:{serializeModes:["initial"]},layerListSettings:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.layerListSettings:this.getDefault("layerListSettings")},sublayerExtensions:{serializeModes:["initial","project"],serialize:e=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{x(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},layer:{serializeModes:["initial","project"],serialize:e=>{if(this.layer){if((this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension)&&(this._layer.id||this._layer.title)){const e=n.getLayerType(this._layer),t=this._getSerializableRefLayerProperties();return{$ref:this._originalRef||{id:this._layer.id,title:this._layer.title,subtype:this._getSerializableLayerType()},layerType:e,...t}}return n.fromEsriApiLayer(this.layer)}return this._deferredLayerProperties?b(this._deferredLayerProperties):void 0},isDefault:()=>{throw new Error("Missing implementation for _getSerializableProperties() > layer > default. Subclasses of LayerExtension must implement this.")},deserialize:e=>{if(p(e)){if(e!==this.layer)throw new Error("Property 'layer' is read-only.")}else e&&(this._layer?this._applyLayerProperties(e,this.layer):this._deferredLayerProperties&&(this._deferredLayerProperties={...this._deferredLayerProperties,...e}))}},dynamicallyAddedLayer:{serializeModes:["project"],default:!1},requestHelper:{serialize:!1}}}_getSerializableLayerType(){}_getSerializableRefLayerProperties(){return{}}_createSublayerExtension(e){if(!this.supportsSublayers)throw new i(C);throw new Error("Missing implementation for _createSublayerExtension(). Subclasses of LayerExtension that support sublayers must implement this.")}async _onInitialize(){if(await super._onInitialize(),await this._createBackingLayer(),this._portalItem&&(await c(this._portalItem),await this._applyPortalItemProperties(this._portalItem),this.layer.title=this._portalItem.title,this.layer.portalItem=this._portalItem,this.iconUrl||(this.iconUrl=this._portalItem.thumbnailUrl),await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),this._resolveLayer(),!this.layer){const e=this._deferredLayerProperties.$ref;throw this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension?new i(`No layer found matching reference "${"string"==typeof e?e:JSON.stringify(e)}".`):new i("Cannot resolve layer reference: missing parent.")}this._deferredLayerProperties&&(await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),await this._initializeLayer(),await c(this.layer),this.supportsSublayers&&!this.layer.sublayers&&this.layer._set("sublayers",new u),this._initialVisibility=this.layer.visible,this._sublayerExtensions.onParentInitialized()}async _postInitialize(){await super._postInitialize(),this.layerListSettings.onLayerExtensionInitialized(),this._watchHandles.push(L(this,"layer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}_applyPortalItemProperties(e){throw new i("Cannot use this type of layer extension with a PortalItem.")}async _initializeLayer(){}_createLayerListSettings(e){return new T(e,this)}_createSublayerExtensionCollection(){return new z(this)}_capabilities(){return A}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}async _createLayer(e){return n.toEsriApiLayer(e)}_applyLayerProperties(e,t){d("layerJson",e).isNotMissing();const i=e.layerType||e.type;return d("layerJson.layerType",i).satisfies((e=>!e||e===this.getDefault("layer")?.layerType),o),d("layer",t).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),o),n.applyToEsriApiLayer(e,t)}_setLayer(e){if(this._layer=e,e.watch("visible",this._onVisibleChanged),this.layer.watch("minScale",(()=>this.notifyChange("effectiveMinScale"))),this.layer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layer.watch("title",(()=>this.notifyChange("title"))),this.supportsSublayers)if(this._sublayers)this._setupSublayersHandles();else{const t=e.watch("sublayers",(()=>{this._setupSublayersHandles(),t.remove()}),!0)}this.notifyChange("layer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_setupSublayersHandles(){this._sublayers.on("change",this._onSublayersChange),E(this._sublayers,"visible",this._onSublayersSublayerVisibleChanged)}_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.layer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}class z extends M{constructor(e){super(e,"_sublayers"),this._layerExtension=e}add(e,t){if(d("sublayerX",e).isNotMissing(),!this._layerExtension.supportsSublayers)throw new i(C);const s=e.sublayer?e.sublayer.layer:void 0;return s&&s!==this._layerExtension.layer&&s.sublayers.remove(e.sublayer),super.add(e,t)}}class j extends y{get _collection(){return this._layerExtension.sublayerExtensions.flatten((e=>e.sublayerExtensions))}constructor(e){super(),this._layerExtension=e}findById(e){return d("id",e).isNotMissing(),this.find((t=>t.id===e))}findBySublayerId(e){return d("id",e).isNotMissing(),this.find((t=>t.sublayer.id===e))}forSublayer(e){return d("sublayer",e).isNotMissing(),this.findBySublayerId(e.id)}emit(e,t){if("change"===e){const i=new u;i.addMany(t.added);const s=i.flatten((e=>e.sublayerExtensions)).toArray(),r=new u;r.addMany(t.removed);const a=r.flatten((e=>e.sublayerExtensions)).toArray(),n=new u;n.addMany(t.moved);const o=n.flatten((e=>e.sublayerExtensions)).toArray();return super.emit(e,{added:s,removed:a,moved:o,target:this})}return super.emit(e,t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}}let T=class extends w{get _esriLayer(){return this._extension.layer}get _listModePath(){return"layer.listMode"}get _supportsChildren(){return this._extension.supportsSublayers}};T=e([h],T);export{T as LayerExtensionLayerListSettings};let V=class extends a{constructor(e){if(super(),this._layerBindings=new Map,this._layerExtension=e,this._bindSettingsToLayerProperties(),e.layer)this._onLayerResolved(e.layer);else{const t=e.watch("layer",(()=>{this._onLayerResolved(e.layer),t.remove()}),!0)}}_getPropertyBindings(){return{}}_getSetting(e,t){if(this._layerBindings.has(e)){let t=this._layerBindings.get(e);if("string"==typeof t&&(t={property:t}),t.hasOwnProperty("value"))return t.value;if(this._layerExtension.layer)return this._layerExtension.layer[t.property]}return super._getSetting(e,t)}_setSetting(e,t){if(this._layerBindings.has(e)){let s=this._layerBindings.get(e);if("string"==typeof s&&(s={property:s}),s.readonly||s.hasOwnProperty("value"))throw new i(ERR_SCHEMA_READ_ONLY);if(this._layerExtension.layer)return void(this._layerExtension.layer[s.property]=t)}super._setSetting(e,t)}_bindSettingsToLayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._layerBindings.set(t,i),i.hasOwnProperty("value")||this._layerExtension.watch(`layer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}_onLayerResolved(e){for(const t of this._layerBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}};V=e([h],V);export{V as LayerExtensionSchema};export function _assignLayerExtensions(e,t){return f(e,t,{onNew:(t,i)=>{e.add(t instanceof LayerExtension?t:LayerExtension.create(t),R(t)?void 0:i)},onMatch:(t,i,s,r)=>{i instanceof LayerExtension||t.assignProperties(i),s===r||R(i)||e.reorder(t,r)},onMissing:t=>{(g([t])||_(t)&&0===t.layerExtensions.toArray().length)&&e.remove(t)},equals:(e,t)=>t instanceof LayerExtension?t===e:!!LayerExtension._matchesRef(e.layer,t.layer)||e.id===t.id})}function O(){return m("geocortex.api.mapping.LayerExtension")}function R(e){return e instanceof LayerExtension?!!e._deferredLayerProperties?.$ref:!p(e.layer)&&!!e.layer?.$ref}let $=class extends V{_setSetting(e,t){if(this._layerBindings.has(e))throw new i(ERR_SCHEMA_READ_ONLY);super._setSetting(e,t)}};$=e([h],$);export{$ as LayerExtensionReadOnlySchema};export const ERR_SCHEMA_READ_ONLY="This schema property is read-only.";
|
|
@@ -25,7 +25,7 @@ export declare function getSublayerType(sublayer: SublayerLike): SublayerType;
|
|
|
25
25
|
/**
|
|
26
26
|
* Well-known sublayer types for use in sublayer JSON.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type SublayerType =
|
|
29
29
|
/**
|
|
30
30
|
* Sublayer for a MapImageLayer.
|
|
31
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{InvalidOperationError}from"../InvalidOperationError.js";import{isSublayerExtension,ItemType}from"../ItemType.js";import{FeatureSourceBase}from"../data/FeatureSourceBase.js";import{Schema}from"../data/Schema.js";import{serializable}from"../support/Serializable.js";import{isBuildingComponentSublayer,isBuildingGroupSublayer,isKMLSublayer,isMapImageSublayer,isSubtypeSublayer,isTileLayer,isWMSSublayer,isWMTSSublayer}from"../utilities/_layers.js";import{checkArg}from"../utilities/checkArg.js";import{compare}from"../utilities/collection.js";import{load}from"../utilities/esri.js";import{getLogger}from"../utilities/log.js";import{parse}from"../utilities/number.js";import{deepClone}from"../utilities/object.js";import{onCollectionPropertyChange,watchCollectionPropertyEach}from"../utilities/watch.js";import{fromLayerListMode,LayerListSettings}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase}from"./support/_SublayerExtensionCollection.js";const log=getLogger("SublayerExtension"),ERR_INVALID_SUBLAYER_TYPE="Invalid type of sublayer for this type of sublayer extension.",ERR_FEATURES_NOT_SUPPORTED="This type of layer does not have features.",ERR_SUBLAYERX_NOT_SUPPORTED="This type of sublayer extension cannot have child sublayer extensions.",DEFAULT_CAPABILITIES=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export function getSublayerType(e){if(isMapImageSublayer(e))return isTileLayer(e?.layer)?"ArcGISTiledSublayer":"ArcGISMapServiceSublayer";if(isKMLSublayer(e))return"KMLSublayer";if(isWMTSSublayer(e))return"WMTSSublayer";if(isWMSSublayer(e))return"WMSSublayer";if(isBuildingComponentSublayer(e))return"BuildingComponentSublayer";if(isBuildingGroupSublayer(e))return"BuildingGroupSublayer";if(isSubtypeSublayer(e))return"SubtypeSublayer";throw new Error(`Unknown sublayer type for ESRI sublayer: ${e}`)}export class SublayerExtension extends FeatureSourceBase{constructor(e){super(e),this._itemType=ItemType.SUBLAYER_EXTENSION,this._watchHandles=[],this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){log.error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._onSetSublayerVisible=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this.sublayerExtensions)for(const t of this.sublayerExtensions.toArray())t.sublayer&&t.canToggleVisibility&&(t.sublayer.visible=e);this.notifyChange("isEffectivelyVisible")},this._onSetSublayersSublayerVisible=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t=e||{};this._visibilityMode=this.canToggleVisibility?"independent":"inherited",this._sublayerExtensions=this._createSublayerExtensionCollection();const i=t.sublayer;let s;i?.hasOwnProperty("listMode")&&(s=fromLayerListMode(i.listMode)),this.layerListSettings=this._createLayerListSettings({...s,...t.layerListSettings}),isSublayer(i)?(checkArg("properties.sublayer",i).satisfies((e=>this._isSupportedSublayer(e)),ERR_INVALID_SUBLAYER_TYPE),this._setSublayer(i)):i&&(this._deferredSublayerProperties=i),this.watch("parentSublayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))}get sublayer(){return this._sublayer}get layerExtension(){return this._layerExtension}get parentSublayerExtension(){return this._parentSublayerExtension}get hasFeatures(){return!1}get sublayerExtensions(){return this._sublayerExtensions}get renderer(){}get visibilityMode(){return this.canToggleVisibility?this._visibilityMode:"inherited"}set visibilityMode(e){checkArg("visibilityMode",e).satisfies((e=>this.canToggleVisibility||"inherited"===e),'Sublayers of this type only support a visibility mode of "inherited".'),this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get capabilities(){return this._capabilities()}get effectiveMinScale(){const e=this.sublayer?this.sublayer.minScale:0;if(this.parentSublayerExtension){const t=this.parentSublayerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}if(this.layerExtension){const t=this.layerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}return e}get effectiveMaxScale(){const e=this.sublayer?this.sublayer.maxScale:0;return this.parentSublayerExtension&&this.parentSublayerExtension.effectiveMaxScale>e?this.parentSublayerExtension.effectiveMaxScale:this.layerExtension&&this.layerExtension.effectiveMaxScale>e?this.layerExtension.effectiveMaxScale:e}get isEffectivelyVisible(){const e=!!this.sublayer&&this.sublayer.visible;return this.parentSublayerExtension?this.parentSublayerExtension.isEffectivelyVisible&&e:this.layerExtension?this.layerExtension.isEffectivelyVisible&&e:e}get title(){return this.sublayer?.title??("string"==typeof this._deferredSublayerProperties?.$ref||"number"==typeof this._deferredSublayerProperties?.$ref?this._deferredSublayerProperties?.$ref.toString():this._deferredSublayerProperties?.$ref?.title??this._deferredSublayerProperties?.$ref?.id.toString())??"Sublayer"}get supportsSublayers(){return!1}get canToggleVisibility(){return!0}get canChangeOpacity(){return!0}get canChangeScale(){return!0}get canChangeRenderer(){return!1}get canChangeLabels(){return!1}get _layerSupportsHideChildren(){return!1}get _sublayers(){if(this.supportsSublayers)return this.sublayer?.sublayers}get effectiveFullExtent(){return this._effectiveFullExtent?this._effectiveFullExtent:this.parentSublayerExtension?this.parentSublayerExtension.effectiveFullExtent:this.layerExtension?this.layerExtension.effectiveFullExtent:void 0}get initialVisibility(){return this._initialVisibility??this.sublayer?.visible??!1}static create(e){if(!SublayerExtension.factory)throw new InvalidOperationError("Cannot create sublayer extension: no sublayer extension factory has been registered.");return SublayerExtension.factory.create(e)}static _matchesRef(e,t,i){if(!e||!t)return!1;let s=t.$ref;if("string"==typeof s){const e=parse(s);s={id:isNaN(e)?s:e,title:s}}else"number"==typeof s&&(s={id:s});const r=isSubtypeSublayer(e)?e.subtypeCode:e.id;return"both"===i?r===s.id&&e.title===s.title:"by-id"===i?r===s.id:"by-title"===i&&e.title===s.title}getFeatures(e,t){if(!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.addFeatures(e,t)}async updateFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.deleteFeatures(e,t)}_resolveSublayer(){if(this._sublayer||!this._deferredSublayerProperties||!this.layerExtension||!this.layerExtension.layer||!this.layerExtension.layer.sublayers)return;const e=e=>t=>SublayerExtension._matchesRef(t,this._deferredSublayerProperties,e),t=this.layerExtension.layer.sublayers.flatten((e=>e.sublayers));let i=t.find(e("both"));if(i||(i=t.find(e("by-title"))),i||(i=t.find(e("by-id"))),i&&this._isSupportedSublayer(i)){this._setSublayer(i);const e={sublayer:this._deferredSublayerProperties};this.assignProperties(e),this._originalRef=this._deferredSublayerProperties.$ref,this._deferredSublayerProperties=void 0}}_setLayerExtension(e){const t=this.layerExtension;this._layerExtension=e,this.layerExtension&&(this.layerExtension.watch("effectiveMinScale",(()=>this.notifyChange("effectiveMinScale"))),this.layerExtension.watch("effectiveMaxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layerExtension.watch("isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))),this._parentSublayerExtension||(t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings))),this._resolveSublayer(),this.notifyChange("layerExtension"),this._sublayerExtensions.onLayerExtensionChanged()}_setParentSublayerExtension(e){const t=this._parentSublayerExtension;this._parentSublayerExtension=e,this.parentSublayerExtension&&(this.parentSublayerExtension.watch("effectiveMinScale",(()=>this.notifyChange("effectiveMinScale"))),this.parentSublayerExtension.watch("effectiveMaxScale",(()=>this.notifyChange("effectiveMaxScale")))),t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.layerExtension?this.layerExtension.featureSettings.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=this.layerExtension?this.layerExtension.taskSettings:void 0)),e&&((!this.featureSettings.formatSettings.parent||this.layerExtension&&this.featureSettings.formatSettings.parent===this.layerExtension.featureSettings.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),(!this.taskSettings.parent||this.layerExtension&&this.taskSettings.parent===this.layerExtension.taskSettings)&&(this.taskSettings.parent=e.taskSettings)),this._resolveSublayer(),this.notifyChange("parentSublayerExtension")}async _switchSublayer(e){if(e===this.sublayer)return;checkArg("newSublayer",e).isNotMissing().satisfies((e=>e.id===this.sublayer.id),"Sublayer ID must match existing sublayer.").satisfies((e=>this._isSupportedSublayer(e)),ERR_INVALID_SUBLAYER_TYPE),this.isInitialized&&await load(e);const t=new Map;if(this.sublayer?.sublayers)for(const e of this.sublayer.sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));this.canToggleVisibility&&(e.visible=this.sublayer.visible),this.canChangeOpacity&&(e.opacity=this.sublayer.opacity),this._setSublayer(e);const i=[];if(this.sublayer.sublayers){const e=this.sublayer.sublayers.filter((e=>t.has(e.id))).toArray();i.push(...e.map((async e=>{const i=t.get(e.id);await i._switchSublayer(e),this._sublayerExtensions._register(i)})))}this.isInitialized&&i.push(this._initializeChildren()),await Promise.all(i)}async _postInitialize(){await super._postInitialize(),this._watchHandles.push(onCollectionPropertyChange(this,"sublayer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}async _onDestroy(){this._watchHandles.forEach((e=>e?.remove())),await Promise.all(this.sublayerExtensions.toArray().map((e=>e.destroy()))),await super._onDestroy()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconUrl:"initial",visibilityMode:{serializeModes:["initial"],default:this.canToggleVisibility?"independent":"inherited"},layerListSettings:"initial",sublayerExtensions:{serializeModes:["initial","project"],serialize:()=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{_assignSublayerExtensions(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},sublayer:{serializeModes:["initial","project"],serialize:()=>{if(this.sublayer){if(!this._layerExtension)return this._serializeSublayer(this._sublayer);{const e=getSublayerType(this._sublayer);if(this._originalRef)return{$ref:this._originalRef,$sublayerType:e};if(this._sublayer.title||this._sublayer.id)return{...this._createSublayerRef(),$sublayerType:e}}}else if(this._deferredSublayerProperties)return deepClone(this._deferredSublayerProperties)},deserialize:e=>{if(isSublayer(e)){if(e!==this.sublayer)throw new Error("Property 'sublayer' is read-only.")}else this._sublayer?this._applySublayerProperties(e,this._sublayer):this._deferredSublayerProperties&&(this._deferredSublayerProperties={...this._deferredSublayerProperties,...e})}},requestHelper:{serialize:!1}}}_createSublayerExtension(e){throw new InvalidOperationError(ERR_SUBLAYERX_NOT_SUPPORTED)}_createSchema(){return new SublayerSchema(this)}_createLayerListSettings(e){return new LayerListSettings(e)}_capabilities(){return DEFAULT_CAPABILITIES}async _onInitialize(){if(await super._onInitialize(),this._sublayer||this._deferredSublayerProperties&&this._deferredSublayerProperties?.$ref||(this._setSublayer(await this._createSublayer(this._deferredSublayerProperties)),this._deferredSublayerProperties=void 0),this._resolveSublayer(),!this._sublayer){const e=this._deferredSublayerProperties?.$ref;if(!this._layerExtension)throw new InvalidOperationError("Cannot resolve sublayer reference: missing parent layer extension.");throw new InvalidOperationError(`No sublayer found matching reference "${e}".`)}this._initialVisibility=this.sublayer.visible,this._sublayerExtensions.onParentInitialized()}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}_createSublayerRef(){return{$ref:{id:isSubtypeSublayer(this._sublayer)?this._sublayer.subtypeCode:this._sublayer.id,title:this._sublayer.title}}}_createSublayerExtensionCollection(){return new SubSublayerExtensionCollection(this)}_watchSublayerProperties(){this._watchHandles.push(this.sublayer.watch("minScale",(()=>this.notifyChange("effectiveMinScale")),!0),this.sublayer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale")),!0))}_setSublayer(e){this._sublayer=e,this._watchHandles.push(e.watch("visible",this._onSetSublayerVisible,!0)),this.supportsSublayers&&this._watchHandles.push(onCollectionPropertyChange(e,"sublayers",this._onSublayersChange,!0),watchCollectionPropertyEach(e,"sublayers","visible",this._onSetSublayersSublayerVisible,!0)),this._onSetSublayerVisible(this.sublayer.visible),"exclusive"===this.visibilityMode&&this._ensureAtMostOneChildSublayerVisible(),this._watchSublayerProperties(),this.notifyChange("sublayer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.sublayer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}let SublayerSchema=class extends Schema{constructor(e){super(),this._sublayerBindings=new Map,this._sublayerExtension=e,this._bindSettingsToSublayerProperties()}get spatialReference(){if(this._sublayerExtension.layerExtension)return this._sublayerExtension.layerExtension.schema.spatialReference}set spatialReference(e){throw new InvalidOperationError("Cannot set sublayer schema spatial reference.")}_getPropertyBindings(){return{}}_bindSettingsToSublayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._sublayerBindings.set(t,i),i.hasOwnProperty("value")||this._sublayerExtension.watch(`sublayer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}};SublayerSchema=__decorate([serializable],SublayerSchema);export{SublayerSchema};export class SubSublayerExtensionCollection extends SublayerExtensionCollectionBase{constructor(e){super(e,"sublayer.sublayers")}get _layerExtension(){return this._parent.layerExtension}add(e,t){if(checkArg("sublayerX",e).isNotMissing(),!this._parent.supportsSublayers)throw new InvalidOperationError(ERR_SUBLAYERX_NOT_SUPPORTED);return e.sublayer&&this._parent.sublayer&&!this._parent.sublayer.sublayers&&(this._parent.sublayer.sublayers=[]),e.parentSublayerExtension&&e.parentSublayerExtension.sublayerExtensions.remove(e),super.add(e,t)}_onAdded(e){super._onAdded(e),e._setParentSublayerExtension(this._parent)}_onRemoved(e){super._onRemoved(e),e._setParentSublayerExtension(void 0)}}export function _assignSublayerExtensions(e,t,i){compare(e,t,{onNew:(t,s)=>{e.add(isSublayerExtension(t)?t:i(t),isSublayerRef(t)?void 0:s)},onMatch:(t,i,s,r)=>{isSublayerExtension(i)||t.assignProperties(i),s===r||isSublayerRef(i)||e.reorder(t,r)},equals:(e,t)=>isSublayerExtension(t)?t===e:!!SublayerExtension._matchesRef(e.sublayer,t.sublayer,"both")||e.id===t.id})}function isSublayer(e){return e&&"function"==typeof e.get}function isSublayerRef(e){return isSublayerExtension(e)?!!e._deferredSublayerProperties?.$ref:!isSublayer(e.sublayer)&&!!e.sublayer?.$ref}
|
|
1
|
+
import{__decorate as e}from"tslib";import{InvalidOperationError as t}from"../InvalidOperationError.js";import{isSublayerExtension as i,ItemType as s}from"../ItemType.js";import{FeatureSourceBase as r}from"../data/FeatureSourceBase.js";import{Schema as a}from"../data/Schema.js";import{serializable as n}from"../support/Serializable.js";import{isBuildingComponentSublayer as l,isBuildingGroupSublayer as o,isKMLSublayer as u,isMapImageSublayer as y,isSubtypeSublayer as h,isTileLayer as b,isWMSSublayer as f,isWMTSSublayer as S}from"../utilities/_layers.js";import{checkArg as p}from"../utilities/checkArg.js";import{compare as c}from"../utilities/collection.js";import{load as d}from"../utilities/esri.js";import{getLogger as g}from"../utilities/log.js";import{parse as _}from"../utilities/number.js";import{deepClone as x}from"../utilities/object.js";import{onCollectionPropertyChange as E,watchCollectionPropertyEach as v}from"../utilities/watch.js";import{fromLayerListMode as m,LayerListSettings as w}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase as M}from"./support/_SublayerExtensionCollection.js";const C=g("SublayerExtension"),P="Invalid type of sublayer for this type of sublayer extension.",V="This type of layer does not have features.",z="This type of sublayer extension cannot have child sublayer extensions.",A=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export function getSublayerType(e){if(y(e))return b(e?.layer)?"ArcGISTiledSublayer":"ArcGISMapServiceSublayer";if(u(e))return"KMLSublayer";if(S(e))return"WMTSSublayer";if(f(e))return"WMSSublayer";if(l(e))return"BuildingComponentSublayer";if(o(e))return"BuildingGroupSublayer";if(h(e))return"SubtypeSublayer";throw new Error(`Unknown sublayer type for ESRI sublayer: ${e}`)}export class SublayerExtension extends r{get sublayer(){return this._sublayer}get layerExtension(){return this._layerExtension}get parentSublayerExtension(){return this._parentSublayerExtension}get hasFeatures(){return!1}get sublayerExtensions(){return this._sublayerExtensions}get renderer(){}get visibilityMode(){return this.canToggleVisibility?this._visibilityMode:"inherited"}set visibilityMode(e){p("visibilityMode",e).satisfies((e=>this.canToggleVisibility||"inherited"===e),'Sublayers of this type only support a visibility mode of "inherited".'),this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get capabilities(){return this._capabilities()}get effectiveMinScale(){const e=this.sublayer?this.sublayer.minScale:0;if(this.parentSublayerExtension){const t=this.parentSublayerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}if(this.layerExtension){const t=this.layerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}return e}get effectiveMaxScale(){const e=this.sublayer?this.sublayer.maxScale:0;return this.parentSublayerExtension&&this.parentSublayerExtension.effectiveMaxScale>e?this.parentSublayerExtension.effectiveMaxScale:this.layerExtension&&this.layerExtension.effectiveMaxScale>e?this.layerExtension.effectiveMaxScale:e}get isEffectivelyVisible(){const e=!!this.sublayer&&this.sublayer.visible;return this.parentSublayerExtension?this.parentSublayerExtension.isEffectivelyVisible&&e:this.layerExtension?this.layerExtension.isEffectivelyVisible&&e:e}get title(){return this.sublayer?.title??("string"==typeof this._deferredSublayerProperties?.$ref||"number"==typeof this._deferredSublayerProperties?.$ref?this._deferredSublayerProperties?.$ref.toString():this._deferredSublayerProperties?.$ref?.title??this._deferredSublayerProperties?.$ref?.id.toString())??"Sublayer"}get supportsSublayers(){return!1}get canToggleVisibility(){return!0}get canChangeOpacity(){return!0}get canChangeScale(){return!0}get canChangeRenderer(){return!1}get canChangeLabels(){return!1}get _layerSupportsHideChildren(){return!1}get _sublayers(){if(this.supportsSublayers)return this.sublayer?.sublayers}get effectiveFullExtent(){return this._effectiveFullExtent?this._effectiveFullExtent:this.parentSublayerExtension?this.parentSublayerExtension.effectiveFullExtent:this.layerExtension?this.layerExtension.effectiveFullExtent:void 0}get initialVisibility(){return this._initialVisibility??this.sublayer?.visible??!1}constructor(e){super(e),this._itemType=s.SUBLAYER_EXTENSION,this._watchHandles=[],this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){C.error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._onSetSublayerVisible=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this.sublayerExtensions)for(const t of this.sublayerExtensions.toArray())t.sublayer&&t.canToggleVisibility&&(t.sublayer.visible=e);this.notifyChange("isEffectivelyVisible")},this._onSetSublayersSublayerVisible=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t=e||{};this._visibilityMode=this.canToggleVisibility?"independent":"inherited",this._sublayerExtensions=this._createSublayerExtensionCollection();const i=t.sublayer;let r;i?.hasOwnProperty("listMode")&&(r=m(i.listMode)),this.layerListSettings=this._createLayerListSettings({...r,...t.layerListSettings}),j(i)?(p("properties.sublayer",i).satisfies((e=>this._isSupportedSublayer(e)),P),this._setSublayer(i)):i&&(this._deferredSublayerProperties=i),this.watch("parentSublayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))}static create(e){if(!SublayerExtension.factory)throw new t("Cannot create sublayer extension: no sublayer extension factory has been registered.");return SublayerExtension.factory.create(e)}static _matchesRef(e,t,i){if(!e||!t)return!1;let s=t.$ref;if("string"==typeof s){const e=_(s);s={id:isNaN(e)?s:e,title:s}}else"number"==typeof s&&(s={id:s});const r=h(e)?e.subtypeCode:e.id;return"both"===i?r===s.id&&e.title===s.title:"by-id"===i?r===s.id:"by-title"===i&&e.title===s.title}getFeatures(e,i){if(!this.hasFeatures)throw new t(V);return super.getFeatures(e,i)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,i){if(p("features",e).isNotMissing(),!this.hasFeatures)throw new t(V);await super.addFeatures(e,i)}async updateFeatures(e,i){if(p("features",e).isNotMissing(),!this.hasFeatures)throw new t(V);await super.updateFeatures(e,i)}async deleteFeatures(e,i){if(p("features",e).isNotMissing(),!this.hasFeatures)throw new t(V);await super.deleteFeatures(e,i)}_resolveSublayer(){if(this._sublayer||!this._deferredSublayerProperties||!this.layerExtension||!this.layerExtension.layer||!this.layerExtension.layer.sublayers)return;const e=e=>t=>SublayerExtension._matchesRef(t,this._deferredSublayerProperties,e),t=this.layerExtension.layer.sublayers.flatten((e=>e.sublayers));let i=t.find(e("both"));if(i||(i=t.find(e("by-title"))),i||(i=t.find(e("by-id"))),i&&this._isSupportedSublayer(i)){this._setSublayer(i);const e={sublayer:this._deferredSublayerProperties};this.assignProperties(e),this._originalRef=this._deferredSublayerProperties.$ref,this._deferredSublayerProperties=void 0}}_setLayerExtension(e){const t=this.layerExtension;this._layerExtension=e,this.layerExtension&&(this.layerExtension.watch("effectiveMinScale",(()=>this.notifyChange("effectiveMinScale"))),this.layerExtension.watch("effectiveMaxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layerExtension.watch("isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))),this._parentSublayerExtension||(t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings))),this._resolveSublayer(),this.notifyChange("layerExtension"),this._sublayerExtensions.onLayerExtensionChanged()}_setParentSublayerExtension(e){const t=this._parentSublayerExtension;this._parentSublayerExtension=e,this.parentSublayerExtension&&(this.parentSublayerExtension.watch("effectiveMinScale",(()=>this.notifyChange("effectiveMinScale"))),this.parentSublayerExtension.watch("effectiveMaxScale",(()=>this.notifyChange("effectiveMaxScale")))),t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.layerExtension?this.layerExtension.featureSettings.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=this.layerExtension?this.layerExtension.taskSettings:void 0)),e&&((!this.featureSettings.formatSettings.parent||this.layerExtension&&this.featureSettings.formatSettings.parent===this.layerExtension.featureSettings.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),(!this.taskSettings.parent||this.layerExtension&&this.taskSettings.parent===this.layerExtension.taskSettings)&&(this.taskSettings.parent=e.taskSettings)),this._resolveSublayer(),this.notifyChange("parentSublayerExtension")}async _switchSublayer(e){if(e===this.sublayer)return;p("newSublayer",e).isNotMissing().satisfies((e=>e.id===this.sublayer.id),"Sublayer ID must match existing sublayer.").satisfies((e=>this._isSupportedSublayer(e)),P),this.isInitialized&&await d(e);const t=new Map;if(this.sublayer?.sublayers)for(const e of this.sublayer.sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));this.canToggleVisibility&&(e.visible=this.sublayer.visible),this.canChangeOpacity&&(e.opacity=this.sublayer.opacity),this._setSublayer(e);const i=[];if(this.sublayer.sublayers){const e=this.sublayer.sublayers.filter((e=>t.has(e.id))).toArray();i.push(...e.map((async e=>{const i=t.get(e.id);await i._switchSublayer(e),this._sublayerExtensions._register(i)})))}this.isInitialized&&i.push(this._initializeChildren()),await Promise.all(i)}async _postInitialize(){await super._postInitialize(),this._watchHandles.push(E(this,"sublayer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}async _onDestroy(){this._watchHandles.forEach((e=>e?.remove())),await Promise.all(this.sublayerExtensions.toArray().map((e=>e.destroy()))),await super._onDestroy()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconUrl:"initial",visibilityMode:{serializeModes:["initial"],default:this.canToggleVisibility?"independent":"inherited"},layerListSettings:"initial",sublayerExtensions:{serializeModes:["initial","project"],serialize:()=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{_assignSublayerExtensions(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},sublayer:{serializeModes:["initial","project"],serialize:()=>{if(this.sublayer){if(!this._layerExtension)return this._serializeSublayer(this._sublayer);{const e=getSublayerType(this._sublayer);if(this._originalRef)return{$ref:this._originalRef,$sublayerType:e};if(this._sublayer.title||this._sublayer.id)return{...this._createSublayerRef(),$sublayerType:e}}}else if(this._deferredSublayerProperties)return x(this._deferredSublayerProperties)},deserialize:e=>{if(j(e)){if(e!==this.sublayer)throw new Error("Property 'sublayer' is read-only.")}else this._sublayer?this._applySublayerProperties(e,this._sublayer):this._deferredSublayerProperties&&(this._deferredSublayerProperties={...this._deferredSublayerProperties,...e})}},requestHelper:{serialize:!1}}}_createSublayerExtension(e){throw new t(z)}_createSchema(){return new F(this)}_createLayerListSettings(e){return new w(e)}_capabilities(){return A}async _onInitialize(){if(await super._onInitialize(),this._sublayer||this._deferredSublayerProperties?.$ref||(this._setSublayer(await this._createSublayer(this._deferredSublayerProperties)),this._deferredSublayerProperties=void 0),this._resolveSublayer(),!this._sublayer){const e=this._deferredSublayerProperties?.$ref;if(!this._layerExtension)throw new t("Cannot resolve sublayer reference: missing parent layer extension.");throw new t(`No sublayer found matching reference "${e}".`)}this._initialVisibility=this.sublayer.visible,this._sublayerExtensions.onParentInitialized()}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}_createSublayerRef(){return{$ref:{id:h(this._sublayer)?this._sublayer.subtypeCode:this._sublayer.id,title:this._sublayer.title}}}_createSublayerExtensionCollection(){return new SubSublayerExtensionCollection(this)}_watchSublayerProperties(){this._watchHandles.push(this.sublayer.watch("minScale",(()=>this.notifyChange("effectiveMinScale")),!0),this.sublayer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale")),!0))}_setSublayer(e){this._sublayer=e,this._watchHandles.push(e.watch("visible",this._onSetSublayerVisible,!0)),this.supportsSublayers&&this._watchHandles.push(E(e,"sublayers",this._onSublayersChange,!0),v(e,"sublayers","visible",this._onSetSublayersSublayerVisible,!0)),this._onSetSublayerVisible(this.sublayer.visible),"exclusive"===this.visibilityMode&&this._ensureAtMostOneChildSublayerVisible(),this._watchSublayerProperties(),this.notifyChange("sublayer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.sublayer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}let F=class extends a{constructor(e){super(),this._sublayerBindings=new Map,this._sublayerExtension=e,this._bindSettingsToSublayerProperties()}get spatialReference(){if(this._sublayerExtension.layerExtension)return this._sublayerExtension.layerExtension.schema.spatialReference}set spatialReference(e){throw new t("Cannot set sublayer schema spatial reference.")}_getPropertyBindings(){return{}}_bindSettingsToSublayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._sublayerBindings.set(t,i),i.hasOwnProperty("value")||this._sublayerExtension.watch(`sublayer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}};F=e([n],F);export{F as SublayerSchema};export class SubSublayerExtensionCollection extends M{get _layerExtension(){return this._parent.layerExtension}constructor(e){super(e,"sublayer.sublayers")}add(e,i){if(p("sublayerX",e).isNotMissing(),!this._parent.supportsSublayers)throw new t(z);return e.sublayer&&this._parent.sublayer&&!this._parent.sublayer.sublayers&&(this._parent.sublayer.sublayers=[]),e.parentSublayerExtension&&e.parentSublayerExtension.sublayerExtensions.remove(e),super.add(e,i)}_onAdded(e){super._onAdded(e),e._setParentSublayerExtension(this._parent)}_onRemoved(e){super._onRemoved(e),e._setParentSublayerExtension(void 0)}}export function _assignSublayerExtensions(e,t,s){c(e,t,{onNew:(t,r)=>{e.add(i(t)?t:s(t),T(t)?void 0:r)},onMatch:(t,s,r,a)=>{i(s)||t.assignProperties(s),r===a||T(s)||e.reorder(t,a)},equals:(e,t)=>i(t)?t===e:!!SublayerExtension._matchesRef(e.sublayer,t.sublayer,"both")||e.id===t.id})}function j(e){return e&&"function"==typeof e.get}function T(e){return i(e)?!!e._deferredSublayerProperties?.$ref:!j(e.sublayer)&&!!e.sublayer?.$ref}
|
package/mapping/convert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@arcgis/core/layers/FeatureLayer";import{toFeature as o,toGraphic as t}from"../data/Feature.js";import{FeatureSet as r}from"../data/FeatureSet.js";import{toCsv as a,csvToFeatureSet as s,toXLSX as i,xlsxToFeatureSet as n,toShapefile as l,shapefileToFeatureSet as c}from"../data/convert.js";import{checkArg as u}from"../utilities/checkArg.js";import{Collection as f}from"../utilities/collection.js";import{FeatureCollectionLayerExtension as y}from"./FeatureCollectionLayerExtension.js";export{GeometryFormat}from"../data/convert.js";export async function toCsv(e,t){u("featureCollection",e).isNotMissing(),u("featureCollection.layer",e.layer).isNotMissing(),u("featureCollection.layer.source",e.layer.source).satisfies((e=>f.isCollection(e)));const s=e.layer.source.map((e=>o(e,void 0))).toArray(),i=new r({features:s});return a(i,t)}export async function csvToFeatureCollection(o,r){u("csvData",o).isNotMissing();const a=await s(o,r),i=Array.from(a).map(t),n=new e({source:i});return new y({layer:n})}export async function toXLSX(e,t){u("featureCollection",e).isNotMissing(),u("featureCollection.layer",e.layer).isNotMissing(),u("featureCollection.layer.source",e.layer.source).satisfies((e=>f.isCollection(e)));const a=e.layer.source.map((e=>o(e,void 0))).toArray(),s=new r({features:a});return i(s,t)}export async function xlsxToFeatureCollection(o,r){u("xlsxData",o).isNotMissing();const a=await n(o,r),s=Array.from(a).map(t),i=new e({source:s});return new y({layer:i})}export async function toShapefile(e,t){u("featureCollection",e).isNotMissing(),u("featureCollection.layer",e.layer).isNotMissing(),u("featureCollection.layer.source",e.layer.source).satisfies((e=>f.isCollection(e)));const a=e.layer.source.map((e=>o(e,void 0))).toArray(),s=new r({features:a});return l(s,t)}export async function shapefileToFeatureCollection(o,r){u("shapefileData",o).isNotMissing();const a=await c(o,r),s=Array.from(a).map(t),i=new e({source:s});return new y({layer:i})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"@arcgis/core/core/Collection";import{CollectionProxy as r}from"../../utilities/CollectionProxy.js";export class ArrayWrappedCollection extends r{get _target(){return this._targetProperty?this._parent.get(this._targetProperty):this._parent}constructor(r,e){if(super(),e)this._parent=r,this._targetProperty=r.hasOwnProperty("sublayer")?"sublayer":"layer",this._arrayProperty=e;else{const{parent:t,targetProperty:e,arrayProperty:s}=r;this._parent=t,this._targetProperty=e,this._arrayProperty=s}if(this._target)this._onTargetResolved(this._target);else{this._collection=new t;const r=this._parent.watch(this._targetProperty,(()=>{const t=this._target;t&&(this.length&&t.set({[this._arrayProperty]:this.toArray()}),this._onTargetResolved(t),r.remove())}),!0)}}add(t,r){const s=this._target;return s&&!s.get(this._arrayProperty)&&(s.set({[this._arrayProperty]:[]}),this._collection=e(s.get(this._arrayProperty))),super.add(t,r)}_onTargetResolved(t){this._collection=e(t.get(this._arrayProperty)??[]),this._parent.watch(this._targetProperty?`${this._targetProperty}.${this._arrayProperty}`:this._arrayProperty,(()=>{this._target&&(this._collection=e(this._target.get(this._arrayProperty)??[]))}),!0)}}function e(r){const e=Array.isArray(r)?r:[],s=new t;return Object.defineProperty(s,"_items",{get:()=>e}),Object.defineProperty(s,"length",{get:()=>e.length,set:t=>e.length=t}),s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError}from"../../ArgumentError.js";import{FeatureLayer as
|
|
1
|
+
import{ArgumentError as e}from"../../ArgumentError.js";import{FeatureLayer as r}from"../../portal/FeatureLayer.js";import{WebTileLayer as n}from"../../portal/WebTileLayer.js";import{isBuildingSceneLayer as a,isCSVLayer as t,isElevationLayer as o,isFeatureLayer as i,isGeoRssLayer as s,isGraphicsLayer as y,isGroupLayer as l,isImageryLayer as c,isImageryTileLayer as m,isIntegratedMeshLayer as p,isKMLLayer as u,isLayer as L,isMapImageLayer as w,isOpenStreetMapLayer as f,isPointCloudLayer as S,isSceneLayer as j,isStreamLayer as E,isSubtypeGroupLayer as x,isTileLayer as G,isVectorTileLayer as I,isWebTileLayer as T,isWMSLayer as M,isWMTSLayer as A}from"../../utilities/_layers.js";import{checkArg as g}from"../../utilities/checkArg.js";import{Collection as d}from"../../utilities/collection.js";import{BuildingSceneLayerExtension as F}from"../BuildingSceneLayerExtension.js";import{CSVLayerExtension as v}from"../CSVLayerExtension.js";import{ElevationLayerExtension as b}from"../ElevationLayerExtension.js";import{FeatureCollectionLayerExtension as W}from"../FeatureCollectionLayerExtension.js";import{FeatureLayerExtension as h}from"../FeatureLayerExtension.js";import{GeoRSSLayerExtension as C}from"../GeoRSSLayerExtension.js";import{GraphicsLayerExtension as V}from"../GraphicsLayerExtension.js";import{GroupLayerExtension as D}from"../GroupLayerExtension.js";import{ImageryLayerExtension as N}from"../ImageryLayerExtension.js";import{ImageryTileLayerExtension as O}from"../ImageryTileLayerExtension.js";import{IntegratedMeshLayerExtension as B}from"../IntegratedMeshLayerExtension.js";import{KMLLayerExtension as K}from"../KMLLayerExtension.js";import{MapImageLayerExtension as P}from"../MapImageLayerExtension.js";import{OpenStreetMapLayerExtension as R}from"../OpenStreetMapLayerExtension.js";import{PointCloudLayerExtension as U}from"../PointCloudLayerExtension.js";import{SceneLayerExtension as k}from"../SceneLayerExtension.js";import{StreamLayerExtension as J}from"../StreamLayerExtension.js";import{SubtypeGroupLayerExtension as $}from"../SubtypeGroupLayerExtension.js";import{TileLayerExtension as _}from"../TileLayerExtension.js";import{UnsupportedLayerExtension as q}from"../UnsupportedLayerExtension.js";import{VectorTileLayerExtension as z}from"../VectorTileLayerExtension.js";import{WMSLayerExtension as H}from"../WMSLayerExtension.js";import{WMTSLayerExtension as Q}from"../WMTSLayerExtension.js";import{WebTileLayerExtension as X}from"../WebTileLayerExtension.js";export class DefaultLayerExtensionFactory{constructor(){}create(Y){if(g("properties",Y).isNotMissing(),g("properties.layer",Y.layer).isNotMissing(),L(Y.layer)){if(a(Y.layer))return new F(Y);if(t(Y.layer))return new v(Y);if(o(Y.layer))return new b(Y);if(E(Y.layer))return new J(Y);if(i(Y.layer)){const{layer:e}=Y;return d.isCollection(e.source)?new W(Y):new h(Y)}return s(Y.layer)?new C(Y):y(Y.layer)?new V(Y):l(Y.layer)?new D(Y):c(Y.layer)?new N(Y):p(Y.layer)?new B(Y):u(Y.layer)?new K(Y):w(Y.layer)?new P(Y):f(Y.layer)?new R(Y):S(Y.layer)?new U(Y):j(Y.layer)?new k(Y):x(Y.layer)?new $(Y):G(Y.layer)?new _(Y):m(Y.layer)?new O(Y):I(Y.layer)?new z(Y):T(Y.layer)?new X(Y):M(Y.layer)?new H(Y):A(Y.layer)?new Q(Y):new q(Y)}if(Y.layer.layerType)switch(Y.layer.layerType){case"BuildingSceneLayer":return new F(Y);case"CSV":return new v(Y);case"ArcGISTiledElevationServiceLayer":return new b(Y);case"ArcGISFeatureLayer":return r.isGraphicsLayerJson(Y.layer)||r.isMapNotesLayer(Y.layer)?new V(Y):r.isFeatureCollection(Y.layer)?new W(Y):new h(Y);case"ArcGISAnnotationLayer":return Y.layer.layerType="ArcGISFeatureLayer",Y.layer.$layerSubType="ArcGISAnnotationLayer",new h(Y);case"GeoRSS":return new C(Y);case"GroupLayer":return new D(Y);case"ArcGISImageServiceLayer":case"ArcGISImageServiceVectorLayer":return new N(Y);case"IntegratedMeshLayer":return new B(Y);case"KML":return new K(Y);case"ArcGISMapServiceLayer":return new P(Y);case"OpenStreetMap":return new R(Y);case"PointCloudLayer":return new U(Y);case"ArcGISSceneServiceLayer":return new k(Y);case"SubtypeGroupLayer":return new $(Y);case"ArcGISStreamLayer":return new J(Y);case"ArcGISTiledImageServiceLayer":return new O(Y);case"ArcGISTiledMapServiceLayer":return new _(Y);case"VectorTileLayer":return new z(Y);case"WebTiledLayer":return n.isTileLayerWMTS(Y.layer)?new Q(Y):new X(Y);case"WMS":return new H(Y)}else if(Y.layer.type&&"OpenStreetMap"===Y.layer.type)return new R(Y);throw new e("properties.layer","Unable to determine correct type of layer extension to create.")}}DefaultLayerExtensionFactory.instance=new DefaultLayerExtensionFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError}from"../../ArgumentError.js";import{isBuildingComponentSublayer,isBuildingGroupSublayer,isKMLSublayer,isMapImageLayer,isMapImageSublayer,isSubtypeSublayer,isTileLayer,isWMSSublayer,isWMTSSublayer}from"../../utilities/_layers.js";import{checkArg}from"../../utilities/checkArg.js";import{BuildingComponentSublayerExtension}from"../BuildingComponentSublayerExtension.js";import{BuildingGroupSublayerExtension}from"../BuildingGroupSublayerExtension.js";import{KMLSublayerExtension}from"../KMLSublayerExtension.js";import{MapImageSublayerExtension}from"../MapImageSublayerExtension.js";import{SubtypeSublayerExtension}from"../SubtypeSublayerExtension.js";import{TileSublayerExtension}from"../TileSublayerExtension.js";import{WMSSublayerExtension}from"../WMSSublayerExtension.js";import{WMTSSublayerExtension}from"../WMTSSublayerExtension.js";export class DefaultSublayerExtensionFactory{constructor(){}create(
|
|
1
|
+
import{ArgumentError as e}from"../../ArgumentError.js";import{isBuildingComponentSublayer as r,isBuildingGroupSublayer as n,isKMLSublayer as t,isMapImageLayer as i,isMapImageSublayer as s,isSubtypeSublayer as u,isTileLayer as o,isWMSSublayer as a,isWMTSSublayer as l}from"../../utilities/_layers.js";import{checkArg as y}from"../../utilities/checkArg.js";import{BuildingComponentSublayerExtension as b}from"../BuildingComponentSublayerExtension.js";import{BuildingGroupSublayerExtension as p}from"../BuildingGroupSublayerExtension.js";import{KMLSublayerExtension as S}from"../KMLSublayerExtension.js";import{MapImageSublayerExtension as m}from"../MapImageSublayerExtension.js";import{SubtypeSublayerExtension as c}from"../SubtypeSublayerExtension.js";import{TileSublayerExtension as f}from"../TileSublayerExtension.js";import{WMSSublayerExtension as w}from"../WMSSublayerExtension.js";import{WMTSSublayerExtension as x}from"../WMTSSublayerExtension.js";export class DefaultSublayerExtensionFactory{constructor(){}create(E){y("properties",E).isNotMissing(),y("properties.sublayer",E.sublayer).isNotMissing();const j=E.sublayer;if(s(j)&&j.layer){if(o(j.layer))return new f(E);if(i(j.layer))return new m(E)}else{if(t(j))return new S(E);if(l(j))return new x(E);if(a(j))return new w(E);if(r(j))return new b(E);if(n(j))return new p(E);if(u(j))return new c(E);if(E.sublayer.$sublayerType)switch(E.sublayer.$sublayerType){case"ArcGISMapServiceSublayer":return new m(E);case"ArcGISTiledSublayer":return new f(E);case"WMSSublayer":return new w(E);case"WMTSSublayer":return new x(E);case"KMLSublayer":return new S(E);case"BuildingComponentSublayer":return new b(E);case"BuildingGroupSublayer":return new p(E);case"SubtypeSublayer":return new c(E)}}throw new e("properties.sublayer","Unable to determine correct type of sublayer extension to create.")}}DefaultSublayerExtensionFactory.instance=new DefaultSublayerExtensionFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{whenOnce}from"@arcgis/core/core/reactiveUtils";import{InvalidOperationError}from"../../InvalidOperationError.js";import{isLayerExtension}from"../../ItemType.js";import{serializable,SerializableBase}from"../../support/Serializable.js";import{checkArg}from"../../utilities/checkArg.js";export class LayerListSettingsProperties{}let
|
|
1
|
+
import{__decorate as i}from"tslib";import{whenOnce as e}from"@arcgis/core/core/reactiveUtils";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{isLayerExtension as d}from"../../ItemType.js";import{serializable as n,SerializableBase as s}from"../../support/Serializable.js";import{checkArg as l}from"../../utilities/checkArg.js";export class LayerListSettingsProperties{}let r=class extends s{get expanded(){return this._expanded}set expanded(i){this._expanded=i}get included(){return this._included}set included(i){this._included=i}get initialExpanded(){return this._initialExpanded}get initialChildrenIncluded(){return this._initialChildrenIncluded}get initialIncluded(){return this._initialIncluded}get childrenIncluded(){return this._childrenIncluded}set childrenIncluded(i){this._childrenIncluded=i}_getSerializableProperties(){return{expanded:{serializeModes:["initial"],default:!1},included:{serializeModes:["initial"],default:!0},childrenIncluded:{serializeModes:["initial"],default:!0}}}};r=i([n],r);export{r as LayerListSettings};export class ExtensionBaseLayerListSettings extends r{constructor(i,t,n){l("extension",t).isNotMissing().isDefined(),super(i),this._extension=t,this._defaultChildrenIncluded=n;const s=()=>d(t)?t.layer:t.sublayer,r=s();"included"in i?(this._initialIncluded=i.included,this.notifyChange("initialIncluded")):(r?this._initialIncluded=this.included:(async()=>{await e(s),this._initialIncluded=this.included,this.notifyChange("initialIncluded")})(),void 0===this._initialIncluded&&(this._initialIncluded=!0,this.notifyChange("initialIncluded"))),"childrenIncluded"in i?(this._initialChildrenIncluded=i.childrenIncluded,this.notifyChange("initialChildrenIncluded")):(r?this._initialChildrenIncluded=this.childrenIncluded:(async()=>{await e(s),this._initialChildrenIncluded=this.childrenIncluded,this.notifyChange("initialChildrenIncluded")})(),void 0===this._initialChildrenIncluded&&(this._initialChildrenIncluded=!0,this.notifyChange("initialChildrenIncluded"))),r?this._initialEsriLayerListMode=r.listMode:(async()=>{await e(s),void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=this._esriLayer.listMode)})(),this._initialExpanded=i.expanded??!1}get included(){return void 0!==super.included?super.included:!this._esriLayer||"hide"!==this._esriLayer.listMode}set included(i){l("value",i).satisfies((i=>"boolean"==typeof i),"LayerListSettings must be set to boolean values"),super.included=i,this._setListMode()}get childrenIncluded(){return void 0!==super.childrenIncluded?super.childrenIncluded:this._esriLayer?this._supportsChildren&&"show"===this._esriLayer.listMode:this._defaultChildrenIncluded??this._supportsChildren}set childrenIncluded(i){if(l("value",i).satisfies((i=>"boolean"==typeof i),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&i)throw new t("Cannot set 'childrenIncluded' to true on a layer that does not support sublayers.");super.childrenIncluded=i,this._setListMode()}get expanded(){return super.expanded}set expanded(i){if(l("value",i).satisfies((i=>"boolean"==typeof i),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&i)throw new t("Cannot set 'expanded' to true on a layer that does not support sublayers.");super.expanded=i}onLayerExtensionInitialized(){this._setListMode(),this._extension.watch(this._listModePath,((i,e)=>{i!==e&&(super.childrenIncluded=void 0,super.included=void 0)}),!0)}_getSerializableProperties(){return{...super._getSerializableProperties(),included:{serializeModes:["initial"],isDefault:i=>!!i},childrenIncluded:{serializeModes:["initial"],isDefault:i=>i===this._childrenIncludedSerializationDefault()}}}_childrenIncludedSerializationDefault(){return this._esriLayer?"show"===this._initialEsriLayerListMode:this._defaultChildrenIncluded??this._supportsChildren}_setListMode(){const i=this._esriLayer;i&&(void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=i.listMode),!this.childrenIncluded&&this._extension._layerSupportsHideChildren&&this.included?i.listMode="hide-children":this.childrenIncluded||this.included?i.listMode="show":i.listMode="hide")}}export function fromLayerListMode(i){const e={};return"hide"===i?e.included=!1:"show"===i?e.included=!0:"hide-children"===i&&(e.childrenIncluded=!1),e}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{FeatureSettings}from"../../data/FeatureSettings.js";import{TableExtension}from"../../data/_TableExtension.js";import{serializable}from"../../support/Serializable.js";import{LayerExtension}from"../_LayerExtension.js";import{SublayerExtension}from"../_SublayerExtension.js";let
|
|
1
|
+
import{__decorate as e}from"tslib";import{FeatureSettings as t}from"../../data/FeatureSettings.js";import{TableExtension as i}from"../../data/_TableExtension.js";import{serializable as s}from"../../support/Serializable.js";import{LayerExtension as n}from"../_LayerExtension.js";import{SublayerExtension as r}from"../_SublayerExtension.js";let o=class extends t{get _bindings(){return this._propertyBindings||(this._propertyBindings=new Map),this._propertyBindings}constructor(e){super(),this._layerExtension=e,this._bindSettingToLayerProperty("popupTemplate");const t=this._getLayerLike(),i=this._getLayerLikeType();if(t)this._onLayerResolved(t);else if(i){const t=e.watch(i,(e=>{this._onLayerResolved(e),t.remove()}),!0)}}_getSerializableProperties(){return{...super._getSerializableProperties(),popupTemplate:{serialize:!1}}}_getSetting(e,t){const i=this._getLayerLike();return this._bindings.has(e)&&i?i.get(this._bindings.get(e)):super._getSetting(e,t)}_setSetting(e,t){const i=this._getLayerLike();this._bindings.has(e)&&i?i.set({[this._bindings.get(e)]:t}):super._setSetting(e,t)}_bindSettingToLayerProperty(e,t){const i=this._getLayerLikeType();if(!i)return;const s=t||e;this._bindings.set(e,s),this._layerExtension.watch(`${i}.${s}`,(()=>this.notifyChange(e)),!0)}_onLayerResolved(e){for(const t of this._bindings.keys())this.isModified(t)&&(e.set({[t]:this.get(t)}),this.reset(t))}_getLayerLike(){return this._layerExtension instanceof n?this._layerExtension.layer:this._layerExtension instanceof i?this._layerExtension.table:this._layerExtension instanceof r?this._layerExtension.sublayer:void 0}_getLayerLikeType(){return this._layerExtension instanceof n?"layer":this._layerExtension instanceof i?"table":this._layerExtension instanceof r?"sublayer":void 0}};o=e([s],o);export{o as PopupTemplateFeatureSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError}from"../../ArgumentError.js";import{InvalidOperationError}from"../../InvalidOperationError.js";import{DefaultRequestHelper}from"../../utilities/RequestHelper.js";import{OgcNamespace}from"../../utilities/_ogc.js";import{checkArg}from"../../utilities/checkArg.js";import{Uri}from"../../utilities/uri.js";import{WfsFeatureType}from"./WfsFeatureType.js";export var WfsVersions;!function(e){e.WFS_1_0="1.0.0",e.WFS_1_1="1.1.0",e.WFS_2_0="2.0.0"}(WfsVersions||(WfsVersions={}));export class WfsCapabilities{
|
|
1
|
+
import{ArgumentError as e}from"../../ArgumentError.js";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{DefaultRequestHelper as s}from"../../utilities/RequestHelper.js";import{OgcNamespace as i}from"../../utilities/_ogc.js";import{checkArg as r}from"../../utilities/checkArg.js";import{Uri as n}from"../../utilities/uri.js";import{WfsFeatureType as a}from"./WfsFeatureType.js";export var WfsVersions;!function(e){e.WFS_1_0="1.0.0",e.WFS_1_1="1.1.0",e.WFS_2_0="2.0.0"}(WfsVersions||(WfsVersions={}));export class WfsCapabilities{get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get url(){return this._url}get wfsVersion(){return this._wfsVersion}get title(){return this._title}get describeFeatureTypeGetUrl(){return this._describeFeatureTypeGetUrl}get describeFeatureTypePostUrl(){return this._describeFeatureTypePostUrl}get getFeatureGetUrl(){return this._getFeatureGetUrl}get getFeaturePostUrl(){return this._getFeaturePostUrl}get getFeatureOutputFormats(){return this._getFeatureOutputFormats}get implementsBasicWfs(){return this._implementsBasicWfs}get allowsWfsQuery(){return this._allowsWfsQuery}get featureTypes(){return this._featureTypes}constructor(e){this.requestHelper=new s,this._allowsWfsQuery=!0,this._isInitialized=!1,this._isDestroyed=!1,this._implementsBasicWfs=!0,this._getFeatureOutputFormats=new Array,this._featureTypes=new Array,this.assignProperties(e)}assignProperties(t){if(r("properties",t).isNotMissing(),!t.hasOwnProperty("url"))throw new e("WfsCapabilities requires a URL");this._url=t.url}async initialize(){if(this._isInitialized)return;const e=new n(this.url);e.queryValues.set("request","GetCapabilities"),e.queryValues.set("service","WFS");const t=await this.requestHelper.request(e.toString()),s=await t.text(),i=(new DOMParser).parseFromString(s,"text/xml");if(!t||!i||!i.childNodes||0===i.childNodes.length)throw new Error(`Response to request for url ${e.toString()} was invalid.`);this._parseCapabilities(i.childNodes[0]),await this._initializeFeatureTypeInfos(),this._isInitialized=!0}async destroy(){this._isDestroyed=!0}_parseCapabilities(t){if(r("data",t).isNotMissing(),"WFS_Capabilities"!==t.localName)throw new e("Unable to parse WFS capabilities: unexpected element encountered.");this._parseServiceIdentification(t),this._parseOperationsMetadata(t),this._parseFeatureTypeList(t)}_parseServiceIdentification(e){r("element",e).isNotMissing();let t=e.getElementsByTagName("ows:ServiceIdentification");t.length||(t=e.getElementsByTagName("ServiceIdentification")),t.length>0&&(this._setWfsVersion(t[0]),this._setWfsTitle(t[0]))}_setWfsVersion(e){r("element",e).isNotMissing();const t=e.getElementsByTagNameNS(e.namespaceURI,"ServiceTypeVersion");if(t.length>0){switch(this._getValue(t[0])){case WfsVersions.WFS_1_0:this._wfsVersion=WfsVersions.WFS_1_0;break;case WfsVersions.WFS_1_1:this._wfsVersion=WfsVersions.WFS_1_1;break;case WfsVersions.WFS_2_0:default:this._wfsVersion=WfsVersions.WFS_2_0}}}_setWfsTitle(e){r("element",e).isNotMissing();const t=e.getElementsByTagNameNS(e.namespaceURI,"Title");let s;t.length>0&&(s=this._getValue(t[0])),null!=s&&(this._title=s)}_parseOperationsMetadata(e){r("element",e).isNotMissing();let t=e.getElementsByTagName("ows:OperationsMetadata");if(t.length||(t=e.getElementsByTagName("OperationsMetadata")),t.length>0){const e=Array.from(t[0].getElementsByTagNameNS(t[0].namespaceURI,"Operation"));e.length>0&&(this._parseGetFeature(e),this._parseDescribeFeatureType(e));const s=Array.from(t[0].getElementsByTagNameNS(t[0].namespaceURI,"Constraint"));s.length>0&&this._parseConstraints(s)}}_parseConstraints(e){if(r("elements",e).isNotMissing(),this.wfsVersion===WfsVersions.WFS_2_0){const t=this._getElementByAttribute(e,"name","ImplementsBasicWFS");if(t){const e=this._getChildElementByLocalName(t,"DefaultValue");if(e){const t=this._getValue(e);this._implementsBasicWfs="TRUE"===t.toUpperCase()}}const s=this._getElementByAttribute(e,"name","QueryExpressions");if(s){const e=this._getChildElementByLocalName(s,"AllowedValues");if(e){Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Value")).some((e=>"wfs:Query"===this._getValue(e)))&&(this._allowsWfsQuery=!0)}}}}_parseGetFeature(e){r("elements",e).isNotMissing();const t=this._getElementByAttribute(e,"name","GetFeature");t&&(this._getFeatureGetUrl=this._parseUrlFromOperationElement(t,"Get"),this._getFeaturePostUrl=this._parseUrlFromOperationElement(t,"Post"),this._setOutputFormat(t))}_parseDescribeFeatureType(e){r("elements",e).isNotMissing();const t=this._getElementByAttribute(e,"name","DescribeFeatureType");t&&(this._describeFeatureTypeGetUrl=this._parseUrlFromOperationElement(t,"Get"),this._describeFeatureTypePostUrl=this._parseUrlFromOperationElement(t,"Post"))}_setOutputFormat(e){let t;r("elements",e).isNotMissing();const s=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Parameter"));if(s.length>0){const e=this._getElementByAttribute(s,"name","outputFormat");if(e&&(t=this.wfsVersion===WfsVersions.WFS_1_0||this.wfsVersion===WfsVersions.WFS_1_1?e:this._getChildElementByLocalName(e,"AllowedValues"),t)){const e=Array.from(t.getElementsByTagNameNS(t.namespaceURI,"Value"));this._getFeatureOutputFormats.push(...e.map((e=>this._getValue(e))).filter((e=>e?.includes("xml"))))}}}_parseUrlFromOperationElement(e,t){r("elements",e).isNotMissing(),r("verb",t).isNotMissing();const s=this._getChildElementByLocalName(e,"DCP");if(s){const e=this._getChildElementByLocalName(s,"HTTP");if(e){const s=this._getChildElementByLocalName(e,t);if(s){const e=s.getAttributeNS(i.XLINK,"href");if(e)return e}}}}_parseFeatureTypeList(e){r("element",e).isNotMissing();const t=this._getChildElementByLocalName(e,"FeatureTypeList");null!==t&&this._parseFeatureTypes(t)}_parseFeatureTypes(e){r("element",e).isNotMissing();const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"FeatureType"));for(const e of t){const t=this._parseFeatureType(e);null!==t&&this._featureTypes.push(t)}}_parseFeatureType(e){r("element",e).isNotMissing();const t={},s=this._getChildElementByLocalName(e,"Name");if(null!==s){const e=this._getValue(s);null!==e&&(t.name=e)}const i=this._getChildElementByLocalName(e,"Title");if(null!==i){const e=this._getValue(i);null!==e&&(t.title=e)}let n="DefaultCRS";this.wfsVersion!==WfsVersions.WFS_1_0&&this.wfsVersion!==WfsVersions.WFS_1_1||(n="DefaultSRS");const o=this._getChildElementByLocalName(e,n);if(null!==o){const e=this._getValue(o);null!==e&&(t.defaultCrs=e)}let l="OtherCRS";this.wfsVersion!==WfsVersions.WFS_1_0&&this.wfsVersion!==WfsVersions.WFS_1_1||(l="OtherSRS");const u=Array.from(e.getElementsByTagNameNS(e.namespaceURI,l));if(null!==u){t.otherCrs=new Array;for(const e of u){const s=this._getValue(e);null!==s&&t.otherCrs.push(s)}}return new a(t)}_getChildElementByLocalName(e,t){r("element",e).isNotMissing(),r("localName",t).isNotMissing();const s=e.getElementsByTagNameNS(e.namespaceURI,t);if(s.length>0)return s[0];const i=e.getElementsByTagName(t);return i.length>0?i[0]:void 0}_getElementByAttribute(e,t,s){r("elements",e).isNotMissing(),r("name",t).isNotMissing(),r("value",s).isNotMissing();for(const i of e)if(i.hasAttribute(t)&&i.getAttribute(t)===s)return i}_getValue(t){if(r("element",t).isNotMissing(),1!==t.childNodes.length||t.childNodes[0].nodeType!==Node.TEXT_NODE)throw new e("Unable to parse element value.");return t.childNodes[0].data}async _initializeFeatureTypeInfos(){if(!this.describeFeatureTypeGetUrl)throw new t("Cannot retrieve feature type info as no DescribeFeatureType url is available");if(0===this.featureTypes.length)return;const e=new n(this.url);e.queryValues.set("SERVICE","WFS"),e.queryValues.set("VERSION",this.wfsVersion),e.queryValues.set("REQUEST","DescribeFeatureType");const s=await this.requestHelper.request(e.toString()),i=await s.text(),r=(new DOMParser).parseFromString(i,"text/xml");if(!s||!r||r.childNodes.length<1)throw new Error("Response to WFS DescribeFeatureType request was invalid.");for(const e of this.featureTypes)this._parseFeatureTypeInfo(e,r.childNodes[0])}_parseFeatureTypeInfo(e,s){r("featureType",e).isNotMissing(),r("element",s).isNotMissing();const i=s.namespaceURI,n=new Array;for(const e of Array.from(s.childNodes))"element"===e.localName&&n.push(e);let a=this._getElementByAttribute(n,i,e.name);if(!a){const t=e.name.indexOf(":");if(t>=0){const s=e.name.slice(t+1,e.name.length);a=this._getElementByAttribute(n,"name",s)}}if(!a)throw new t(`Unable to parse attribute information for feature type: ${e.name}`);const o=a.getAttribute("type"),l=Array.from(s.getElementsByTagNameNS(i,"complexType"));let u=this._getElementByAttribute(l,"name",o);if(!u){const e=o.indexOf(":");if(e>=0){const t=o.slice(e+1,o.length);u=this._getElementByAttribute(l,"name",t)}}if(!u)throw new t(`Unable to parse attribute information for feature type: ${e.name}`);const m=u.getElementsByTagNameNS(i,"extension");if(m&&m.length>0){const t=m[0].getElementsByTagNameNS(i,"sequence");if(t&&t.length>0){const s=t[0].getElementsByTagNameNS(i,"element");s&&s.length>0&&this._parseAttributes(e,s)}}}_parseAttributes(e,t){const s=Array.from(t);for(const t of s)if(t.getAttribute("type").startsWith("gml")){const s=t.getAttribute("name");e.attributes.push(s),e.geometryField=s}else e.attributes.push(t.getAttribute("name"))}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkArg}from"../../utilities/checkArg.js";export class WfsFeatureType{
|
|
1
|
+
import{checkArg as t}from"../../utilities/checkArg.js";export class WfsFeatureType{get name(){return this._name}get title(){return this._title}get defaultCrs(){return this._defaultCrs}get otherCrs(){return this._otherCrs}get attributes(){return this._attributes}get geometryField(){return this._geometryField}set geometryField(t){this._geometryField=t}constructor(e){if(this._otherCrs=new Array,this._attributes=new Array,t("properties",e).isNotMissing(),e.hasOwnProperty("name")&&(this._name=e.name),e.hasOwnProperty("title")&&(this._title=e.title),e.hasOwnProperty("name")&&(this._defaultCrs=e.defaultCrs),e.hasOwnProperty("otherCrs"))for(const t of e.otherCrs)this._otherCrs.push(t);if(e.hasOwnProperty("attributes"))for(const t of e.attributes)this._attributes.push(t);e.hasOwnProperty("geometryField")&&(this._geometryField=e.geometryField)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InvalidOperationError}from"../../InvalidOperationError.js";import{InitializableCollectionProxy}from"../../support/InitializableCollectionProxy.js";import{checkArg}from"../../utilities/checkArg.js";import{Collection}from"../../utilities/collection.js";import{layersAreEquivalent}from"../../utilities/layers.js";import{getLogger}from"../../utilities/log.js";import{onCollectionPropertyChange}from"../../utilities/watch.js";import{LayerExtension}from"../_LayerExtension.js";export class LayerExtensionCollectionBase extends
|
|
1
|
+
import{InvalidOperationError as e}from"../../InvalidOperationError.js";import{InitializableCollectionProxy as i}from"../../support/InitializableCollectionProxy.js";import{checkArg as t}from"../../utilities/checkArg.js";import{Collection as s}from"../../utilities/collection.js";import{layersAreEquivalent as r}from"../../utilities/layers.js";import{getLogger as n}from"../../utilities/log.js";import{onCollectionPropertyChange as a}from"../../utilities/watch.js";import{LayerExtension as o}from"../_LayerExtension.js";export class LayerExtensionCollectionBase extends i{get _collection(){return this._layers.map((e=>this._forLayer(e))).concat(this._uninitializedLayerExtensions)}get _layers(){let e=this._parent.get(this._layersProperty);return e||(this._tempLayers||(this._tempLayers=new s),e=this._tempLayers),e}constructor(e,i){super(),this._layerExtensionMap=new WeakMap,this._uninitializedLayerExtensions=new s,this._parent=e,this._layersProperty=i,a(this._parent,this._layersProperty,(e=>{try{const i={added:(e.added||[]).map((e=>this._forLayer(e))),moved:(e.moved||[]).map((e=>this._forLayer(e))),removed:(e.removed||[]).map((e=>this._forLayer(e)))};this.emit("change",i)}catch(e){e instanceof Error&&n("geocortex.api.support.LayerExtensionCollection").error(e.message)}})),this._parent.watch(`${this._layersProperty}.length`,(()=>this.notifyChange("length")))}emit(e,i){const t=super.emit(e,i);return"change"===e&&this._mapExtension&&this._mapExtension.allLayerExtensions.emit(e,i),t}clone(){const e=super.clone();return e._layerExtensionMap=this._layerExtensionMap,e}findById(e){return t("id",e).isNotMissing(),this.find((i=>i.id===e))}findByLayerId(e){return t("id",e).isNotMissing(),this.find((i=>i.layer.id===e))}forLayer(e){if(t("layer",e).isNotMissing(),this._layers.includes(e))return this._forLayer(e)}add(e,i){if(t("layerX",e).isNotMissing(),this._register(e),e.layer)this._layers.includes(e.layer)?void 0!==i&&this._layers.reorder(e.layer,i):this._layers.add(e.layer,i);else if(!e.isInitialized){const t=e.watch("layer",(()=>{e.layer&&(this._forLayer(e.layer),this._layers.includes(e.layer)||this._layers.add(e.layer,i)),t.remove()}),!0)}return this}removeAt(e){const i=this.getItemAt(e);if(void 0!==i){if(this._uninitializedLayerExtensions.includes(i)){this._uninitializedLayerExtensions.remove(i);const e={added:[],moved:[],removed:[i],target:this};this.emit("change",e)}else this._layers.remove(i.layer);return this._onRemoved(i),i}}reorder(i,t){if(this._uninitializedLayerExtensions.includes(i)){if(this._uninitializedLayerExtensions.some((e=>e.isInitialized)))throw new e("Unable to reorder a mix of initialized / uninitialized layers.");this._uninitializedLayerExtensions.reorder(i,t)}if(i?.layer&&this._layers.includes(i.layer))return this._layers.reorder(i.layer,t),i}sort(e){return this._layers.sort(((i,t)=>e(this._forLayer(i),this._forLayer(t)))),this}onParentInitialized(){this._tempLayers?.length&&(this.addMany(this._tempLayers.map((e=>this._forLayer(e)))),this._tempLayers=void 0)}onMapExtensionChanged(){for(const e of this.toArray())e._setMapExtension(this._mapExtension)}_forLayer(e){for(const e of this._uninitializedLayerExtensions.toArray())e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this.emit("change",{added:[],moved:[],removed:[e],target:this}));if(!this._layerExtensionMap.has(e)){const i=this._uninitializedLayerExtensions.find((i=>r(e,i)));if(i)return i;const t=o.create({layer:e});this._register(t)}return this._layerExtensionMap.get(e)}_register(e){if(t("layerX",e).isNotMissing(),e._setMapExtension(this._mapExtension),e.layer||e._resolveLayer(this._layers),e.layer){const i=this._layerExtensionMap.get(e.layer);if(e===i)return;if(this._layerExtensionMap.set(e.layer,e),i&&(this._onRemoved(i),this._layers.includes(e.layer))){const t={added:[e],moved:[],removed:[i],target:this};this.emit("change",t)}}else{this._uninitializedLayerExtensions.add(e);const i={added:[e],moved:[],removed:[],target:this};this.emit("change",i)}this._onAdded(e)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.layer}_onAdded(e){}_onRemoved(e){e._setMapExtension(void 0)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InitializableCollectionProxy}from"../../support/InitializableCollectionProxy.js";import{checkArg}from"../../utilities/checkArg.js";import{Collection}from"../../utilities/collection.js";import{onCollectionPropertyChange}from"../../utilities/watch.js";import{SublayerExtension}from"../_SublayerExtension.js";export class SublayerExtensionCollectionBase extends
|
|
1
|
+
import{InitializableCollectionProxy as e}from"../../support/InitializableCollectionProxy.js";import{checkArg as s}from"../../utilities/checkArg.js";import{Collection as t}from"../../utilities/collection.js";import{onCollectionPropertyChange as i}from"../../utilities/watch.js";import{SublayerExtension as r}from"../_SublayerExtension.js";export class SublayerExtensionCollectionBase extends e{get _collection(){return this._sublayers.map((e=>this._forSublayer(e))).concat(Array.from(this._uninitializedSublayerExtensions))}get _sublayers(){let e=this._parent.get(this._sublayersProperty);return e||(this._tempSublayers||(this._tempSublayers=new t),e=this._tempSublayers),e}constructor(e,s){super(),this._sublayerExtensionMap=new WeakMap,this._uninitializedSublayerExtensions=new Set,this._parent=e,this._sublayersProperty=s,i(this._parent,this._sublayersProperty,(e=>{const s={added:(e.added||[]).map((e=>this._forSublayer(e))),moved:(e.moved||[]).map((e=>this._forSublayer(e))),removed:(e.removed||[]).map((e=>this._forSublayer(e)))};this.emit("change",s)})),this._parent.watch(`${this._sublayersProperty}.length`,(()=>this.notifyChange("length")))}clone(){const e=super.clone();return e._sublayerExtensionMap=this._sublayerExtensionMap,e}findById(e){return s("id",e).isNotMissing(),this.find((s=>s.id===e))}findBySublayerId(e){return s("id",e).isNotMissing(),this.find((s=>s.sublayer.id===e))}forSublayer(e){if(s("sublayer",e).isNotMissing(),!(this._sublayers.indexOf(e)<0))return this._forSublayer(e)}add(e,t){return s("sublayerX",e).isNotMissing(),this._register(e),e.sublayer&&(this._sublayers.includes(e.sublayer)?void 0!==t&&this.reorder(e,t):this._sublayers.add(e.sublayer,t)),this}removeAt(e){const s=this.getItemAt(e);if(void 0!==s){if(this._uninitializedSublayerExtensions.has(s)){this._uninitializedSublayerExtensions.delete(s);const e={added:[],moved:[],removed:[s],target:this};this.emit("change",e)}else this._sublayers.removeAt(e);return this._onRemoved(s),s}}reorder(e,s){if(!e)return;const t=this._sublayers.indexOf(e.sublayer);return t<0?void 0:(t!==s&&this._sublayers.reorder(e.sublayer,s),e)}sort(e){return this._sublayers.sort(((s,t)=>e(this._forSublayer(s),this._forSublayer(t)))),this}emit(e,s){const t=super.emit(e,s);return"change"===e&&this._layerExtension&&this._layerExtension.allSublayerExtensions.emit(e,s),t}onParentInitialized(){this._tempSublayers?.length&&(this.addMany(this._tempSublayers.map((e=>this._forSublayer(e)))),this._tempSublayers=void 0)}onLayerExtensionChanged(){for(const e of this.toArray())e._setLayerExtension(this._layerExtension)}_register(e){if(s("sublayerX",e).isNotMissing(),e._setLayerExtension(this._layerExtension),e.sublayer||e._resolveSublayer(),e.sublayer){const s=this._sublayerExtensionMap.get(e.sublayer);if(e===s)return;if(this._sublayerExtensionMap.set(e.sublayer,e),s&&(this._onRemoved(s),this._sublayers.includes(e.sublayer))){const t={added:[e],moved:[],removed:[s],target:this};this.emit("change",t)}}else{this._uninitializedSublayerExtensions.add(e);const s={added:[e],moved:[],removed:[],target:this};this.emit("change",s)}this._onAdded(e)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}_onAdded(e){}_onRemoved(e){e._setLayerExtension(void 0)}_forSublayer(e){for(const e of this._uninitializedSublayerExtensions)e._resolveSublayer(),e.sublayer&&(this._sublayerExtensionMap.set(e.sublayer,e),this._uninitializedSublayerExtensions.delete(e));if(!this._sublayerExtensionMap.has(e)){const s=r.create({sublayer:e});this._register(s)}return this._sublayerExtensionMap.get(e)}}
|
package/mapping/support/_kml.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"@arcgis/core/layers/KMLLayer";import a from"@arcgis/core/layers/support/KMLSublayer";export{a as KMLSublayer,r as KMLLayer};
|
package/mapping/support/ogc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@arcgis/core/popup/FieldInfo";import{Feature as t}from"../../data/Feature.js";import{FieldExtension as o}from"../../data/FieldExtension.js";import{Field as i}from"../../portal/Field.js";import{isGmlNamespace as n,OgcNamespace as s}from"../../utilities/_ogc.js";import{checkArg as l}from"../../utilities/checkArg.js";import{gmlToEsri as r}from"../../utilities/geometry.js";export function wfsFeatureCollectionToFeatures(m,f){let c;l("featureCollection",m).isNotMissing(),l("featureCollection.localName",m.localName).satisfies((e=>"FeatureCollection"===e),"Unable to parse WFS FeatureCollection: unexpected element encountered");const d=m.namespaceURI;return d===s.WFS?c=Array.from(m.getElementsByTagNameNS(s.GML,"featureMember")):d===s.WFS_2_0&&(c=Array.from(m.getElementsByTagNameNS(m.namespaceURI,"member"))),c.map((s=>function(s,m){let f,c;l("member",s).isNotMissing();const d=new Map;if(s.childElementCount>0){const e=s.firstElementChild;if(f=function(e){l("element",e).isNotMissing();const t=Array.from(e.attributes);for(const e of t){if(n(e.namespaceURI)&&e.nodeType===Node.ATTRIBUTE_NODE)return e.nodeValue;if(!(void 0!==e.namespaceURI&&null!==e.namespaceURI||"fid"!==e.localName&&"gid"!==e.localName||e.nodeType!==Node.ATTRIBUTE_NODE))return e.nodeValue}return}(e),e.childElementCount>0){const t=Array.from(e.childNodes).filter((e=>e.nodeType===e.ELEMENT_NODE));for(const e of t)e.childElementCount>0&&n(e.firstElementChild.namespaceURI)?c=r(e.firstElementChild):d.set(e.localName,a(e))}}const u=new t({id:f,attributes:d,geometry:c,source:m}),p=[];for(const e of u.presentableAttributes.keys())p.push(e);const{popupTemplate:N}=u.settings;N&&(u.title||(N.title="{ID}",u.attributes.set("ID",u.id)),N.fieldInfos&&0!==N.fieldInfos.length||(N.fieldInfos=p.map((t=>new e({fieldName:t})))));if(0===m?.schema.fieldExtensions.initializedItems.length)for(const e of p){const t=new o({field:i.toEsriApiField({name:e,alias:e})});m.schema.fieldExtensions.add(t)}return u}(s,f)))}function a(e){if(l("element",e).isNotMissing(),1===e.childNodes.length&&e.childNodes[0].nodeType===Node.TEXT_NODE)return e.childNodes[0].data}
|
package/menus/Menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e;import{__decorate as t}from"tslib";import{EntityBase as i}from"../Entity.js";import{InvalidOperationError as r}from"../InvalidOperationError.js";import{isMenuItem as s,ItemType as n}from"../ItemType.js";import{serializable as o}from"../support/Serializable.js";import{CollectionProxy as m}from"../utilities/CollectionProxy.js";import{checkArg as u}from"../utilities/checkArg.js";import{Collection as a,compare as l}from"../utilities/collection.js";import{getLogger as c}from"../utilities/log.js";import{MenuItem as d}from"./MenuItem.js";const p=c("geocortex.api.menus.Menu");let h=e=class extends i{get parentItem(){return this._parentItem}get title(){return this._title}set title(e){this._title=e}get items(){return this._items}constructor(e){super(e),this._itemType=n.MENU,this._items=new f(this)}static create(t){if(!e.factory)throw new r("Cannot create menu: no menu factory has been registered.");return e.factory.create(t)}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.items}_getSerializableProperties(){return{...super._getSerializableProperties(),items:{serializeModes:["initial"],default:[],deserialize:e=>{const t=new Map;for(const i of e)s(i)?t.set(i.toJSON(),i):t.set(i,void 0);l(this.items,t.keys(),{onNew:e=>{this.items.add(t.get(e)||d.create(e))},onMissing:e=>{this.items.remove(e)},onMatch:(e,i,r,s)=>{r!==s&&this.items.reorder(e,s),t.get(i)!==e&&e.assignProperties(i)},equals:(e,t)=>e.id===t.id})}},title:"initial"}}};h.factory={create:t=>new e(t)},h=e=t([o],h);export{h as Menu};class f extends m{constructor(e){super(new a),this._menu=e}add(e,t){if(u("menuItem",e).isNotMissing(),this._createsCircularReference(this._allSubmenus(e)))throw new r("Adding menu item would create circular menu dependency.");return e.menu&&(e.menu!==this._menu&&p.debug("A MenuItem can only have one parent. The MenuItem has been removed from its original Menu."),e.menu.items.remove(e)),e._menu=this._menu,super.add(e,t)}removeAt(e){const t=super.removeAt(e);return t&&delete t._menu,t}_createsCircularReference(e,t,i){const r=t??this._menu,s=i??(this._menu.parentItem?.root?this._menu.parentItem.root:this._menu);if(e.includes(r))return!0;if(r===s)return!1;const n=r.parentItem.menu;return this._createsCircularReference(e,n,s)}_allSubmenus(e){const t=new a;if(e.submenu){t.add(e.submenu);for(const i of e.submenu.items.toArray())t.addMany(this._allSubmenus(i))}return t}}
|
package/menus/MenuItem.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e;import{__decorate as t}from"tslib";import{EntityBase as i}from"../Entity.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{isMenu as n,ItemType as r}from"../ItemType.js";import{serializable as a}from"../support/Serializable.js";import{Collection as o}from"../utilities/collection.js";import{Menu as u}from"./Menu.js";let l=e=class extends i{constructor(e){super(e),this._itemType=r.MENU_ITEM,this._isToggled=!1,this._isEnabled=!0,this._hideOnDisable=!1,this._isToggled=e?.isToggled??!1}get canBeToggled(){return!!this.alternate}get isToggled(){return this._isToggled}get submenu(){return this._submenu}set submenu(e){if(e&&this._createsCircularReference(this._allSubmenus(e)))throw new s("Menu is already part of the menu hierarchy.");this._submenu&&delete this._submenu._parentItem,this._submenu=e,this._submenu&&(this._submenu._parentItem=this)}get menu(){return this._menu}get root(){return this.menu?.parentItem?.root?this.menu.parentItem.root:this.menu}get iconId(){return this._iconId}set iconId(e){this._iconId=e}get title(){return this._title}set title(e){this._title=e}get description(){return this._description}set description(e){this._description=e}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled=e}get hideOnDisable(){return this._hideOnDisable}set hideOnDisable(e){this._hideOnDisable=e}get action(){return this._action}set action(e){this._action=e}get alternate(){return this._alternate}set alternate(e){this._alternate=e}static create(t){if(!e.factory)throw new s("Cannot create menu item: no menu item factory has been registered.");return e.factory.create(t)}toggle(){if(!this.canBeToggled)throw new s("This menu item cannot be toggled. Set `alternate` to enable toggling.");this._isToggled=!this._isToggled;for(const e of Object.keys(this.alternate)){const t=this.alternate[e];this.alternate[e]=this[e],this[e]=t}}async _onInitialize(){await super._onInitialize(),this.submenu&&await this.submenu.initialize()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconId:"initial",title:"initial",description:"initial",isEnabled:{serializeModes:["initial"],default:!0},hideOnDisable:{serializeModes:["initial"],default:!1},isToggled:{serializeModes:["initial"],deserialize:!1,default:!1},action:"initial",alternate:{serializeModes:["initial"],deserialize:e=>{this.alternate=e?{...e}:void 0}},submenu:{serializeModes:["initial"],deserialize:e=>{e?n(e)?this.submenu=e:this.submenu?this.submenu.assignProperties(e):this.submenu=u.create(e):this.submenu=void 0}}}}_createsCircularReference(e,t,i){if(!t&&!this.menu)return!1;const s=t??this.menu,n=i??(this.menu.parentItem?.root?this.menu.parentItem.root:this.menu);if(e.includes(s))return!0;if(s===n)return!1;const r=s.parentItem.menu;return this._createsCircularReference(e,r,n)}_allSubmenus(e){const t=new o;t.add(e);for(const i of e.items.toArray())i.submenu&&t.addMany(this._allSubmenus(i.submenu));return t}};l.factory={create:t=>new e(t)},l=e=t([a],l);export{l as MenuItem};
|