layout: default title: Sublayer parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Layers

Sublayer Class

Represents a Sublayer in a MapImageLayer or a TileLayer. MapImageLayer allows you to display, query, and analyze layers from data defined in a map service. Map services contain Sublayers with properties such as renderer, labelingInfo, and definitionExpression, and others that are defined on the server. The properties of each MapImageLayer Sublayer on the map service may be dynamically changed by the user or developer. The properties of each TileLayer Sublayer are read-only, and cannot be modified.
ArcGIS Maps SDK for JavaScript

public class Sublayer : dymaptic.GeoBlazor.Core.Components.MapComponent

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Sublayer

Constructors

Sublayer() Constructor

Parameterless constructor for use as a Razor component.

public Sublayer();

Sublayer(Nullable, Nullable, Nullable, Nullable, Nullable, Nullable, Nullable, Nullable, string, Nullable, string, LayerFloorInfo, IEnumerable

Creates a new Sublayer in code with parameters.

public Sublayer(System.Nullable<int> sublayerId=null, System.Nullable<bool> labelsVisible=null, System.Nullable<bool> legendEnabled=null, System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.ListMode> listMode=null, System.Nullable<int> maxScale=null, System.Nullable<int> minScale=null, System.Nullable<double> opacity=null, System.Nullable<bool> popupEnabled=null, string? title=null, System.Nullable<bool> visible=null, string? definitionExpression=null, dymaptic.GeoBlazor.Core.Components.Layers.LayerFloorInfo? floorInfo=null, System.Collections.Generic.IEnumerable<dymaptic.GeoBlazor.Core.Components.Layers.Label>? labelingInfo=null, dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate? popupTemplate=null, dymaptic.GeoBlazor.Core.Components.Renderers.Renderer? renderer=null, dymaptic.GeoBlazor.Core.Components.Layers.DynamicLayer? source=null, System.Collections.Generic.IEnumerable<dymaptic.GeoBlazor.Core.Components.Layers.Sublayer>? sublayers=null);

Parameters

sublayerId System.Nullable<System.Int32>

The sublayer’s layer ID. When a source is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a DynamicDataLayer or a MapDataLayer and adding it to the source property of the sublayer, the value of this property can be anything set by the developer.

labelsVisible System.Nullable<System.Boolean>

Indicates if labels for the sublayer will be visible in the view.

legendEnabled System.Nullable<System.Boolean>

Indicates whether the layer will be included in the legend. When false, the layer will be excluded from the legend.

listMode System.Nullable<ListMode>

Indicates how the layer should display in the LayerList widget. The possible values are listed below.

maxScale System.Nullable<System.Int32>

The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a maximum scale. The maxScale value should always be smaller than the minScale value, and greater than or equal to the service specification.

minScale System.Nullable<System.Int32>

The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a minimum scale. The minScale value should always be larger than the maxScale value, and less than or equal to the service specification.

opacity System.Nullable<System.Double>

The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where 0 is fully transparent and 1.0 is fully opaque. If the MapImageLayer.opacity is set, the actual opacity value of the sublayer will be the value of MapImageLayer.opacity multiplied by the sublayer’s opacity.

popupEnabled System.Nullable<System.Boolean>

Indicates whether to display popups when features in the layer are clicked. The layer’s popupTemplate is used to define the content of the popup. If popupEnabled is false, then the popupTemplate is ignored.

title System.String

The title of the sublayer. This is the name that is displayed to the user in places such as the LayerList widget.

visible System.Nullable<System.Boolean>

Indicates whether the layer is visible in the view.

definitionExpression System.String

A SQL where clause used to filter features in the image. Only the features that satisfy the definition expression are displayed in the View. Definition expressions may be set when a Sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. To see if you can use this property, check the supportsSublayerDefinitionExpression property of MapImageLayer.capabilities.

floorInfo LayerFloorInfo

If a map image layer contains a sublayer which is meant to be floor-aware, then that sublayer must have a floorInfo property, containing a LayerFloorInfo object which has a string property to represent the floorField.

labelingInfo System.Collections.Generic.IEnumerable<Label>

The label definition for this layer, specified as an array of LabelClass objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size.

popupTemplate PopupTemplate

The popup template for the sublayer. When set, the popupTemplate allows users to access attributes and display their values in the view’s popup when the user clicks the image.

renderer Renderer

The renderer to apply to the sublayer. This value overrides the renderer read from the map service. To see if you can use this property, check the supportsDynamicLayers property of MapImageLayer.capabilities.

source DynamicLayer

An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See DynamicMapLayer for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see DynamicDataLayer.

sublayers System.Collections.Generic.IEnumerable<Sublayer>

An array of sublayers. This property is only available after the sublayer has been loaded.

Properties

Sublayer.Capabilities Property

Describes the layer’s supported capabilities.

public dymaptic.GeoBlazor.Core.Components.Layers.SublayerCapabilities? Capabilities { get; set; }

Property Value

SublayerCapabilities

Sublayer.DefinitionExpression Property

A SQL where clause used to filter features in the image. Only the features that satisfy the definition expression are displayed in the View. Definition expressions may be set when a Sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. To see if you can use this property, check the supportsSublayerDefinitionExpression property of MapImageLayer.capabilities.

public string? DefinitionExpression { get; set; }

Property Value

System.String

Sublayer.Fields Property

An array of fields in the Sublayer. Each field represents an attribute that may contain a value for each feature in the Sublayer. This property is only available after the Sublayer has been loaded.

public dymaptic.GeoBlazor.Core.Components.Layers.Field[]? Fields { get; set; }

Property Value

Field[]

Sublayer.FieldsIndex Property

A convenient property that can be used to make case-insensitive lookups for a field by name. It can also provide a list of the date fields in a Sublayer. This property is only available after the Sublayer has been loaded.

public dymaptic.GeoBlazor.Core.Components.Layers.FieldsIndex? FieldsIndex { get; set; }

Property Value

FieldsIndex

Sublayer.FloorInfo Property

If a map image layer contains a sublayer which is meant to be floor-aware, then that sublayer must have a floorInfo property, containing a LayerFloorInfo object which has a string property to represent the floorField.

public dymaptic.GeoBlazor.Core.Components.Layers.LayerFloorInfo? FloorInfo { get; set; }

Property Value

LayerFloorInfo

Sublayer.FullExtent Property

Rhe full extent of the Sublayer. This property is only available after the Sublayer has been loaded.

public dymaptic.GeoBlazor.Core.Components.Geometries.Extent? FullExtent { get; set; }

Property Value

Extent

Sublayer.LabelingInfo Property

The label definition for this layer, specified as an array of LabelClass objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size.

public System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Layers.Label> LabelingInfo { get; set; }

Property Value

System.Collections.Generic.IReadOnlyCollection<Label>

Sublayer.LabelsVisible Property

Indicates if labels for the sublayer will be visible in the view.
Default Value: true

public System.Nullable<bool> LabelsVisible { get; set; }

Property Value

System.Nullable<System.Boolean>

Sublayer.Layer Property

The MapImageLayer or TileLayer to which the sublayer belongs.

public dymaptic.GeoBlazor.Core.Components.Layers.Layer? Layer { get; }

Property Value

Layer

Sublayer.LegendEnabled Property

Indicates whether the layer will be included in the legend. When false, the layer will be excluded from the legend.
Default Value: true

public System.Nullable<bool> LegendEnabled { get; set; }

Property Value

System.Nullable<System.Boolean>

Sublayer.ListMode Property

Indicates how the layer should display in the LayerList widget. The possible values are listed below.

public System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.ListMode> ListMode { get; set; }

Property Value

System.Nullable<ListMode>

Sublayer.MaxScale Property

The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a maximum scale. The maxScale value should always be smaller than the minScale value, and greater than or equal to the service specification.

public System.Nullable<int> MaxScale { get; set; }

Property Value

System.Nullable<System.Int32>

Sublayer.MinScale Property

The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a minimum scale. The minScale value should always be larger than the maxScale value, and less than or equal to the service specification.

public System.Nullable<int> MinScale { get; set; }

Property Value

System.Nullable<System.Int32>

Sublayer.ObjectIdField Property

The name of an oid field containing a unique value or identifier for each feature in the Sublayer.

public string? ObjectIdField { get; set; }

Property Value

System.String

Sublayer.Opacity Property

The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where 0 is fully transparent and 1.0 is fully opaque. If the MapImageLayer.opacity is set, the actual opacity value of the sublayer will be the value of MapImageLayer.opacity multiplied by the sublayer’s opacity.

public System.Nullable<double> Opacity { get; set; }

Property Value

System.Nullable<System.Double>

Sublayer.PopupEnabled Property

Indicates whether to display popups when features in the layer are clicked. The layer needs to have a popupTemplate to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if Popup.defaultPopupTemplateEnabled is set to true.
Default Value: true

public System.Nullable<bool> PopupEnabled { get; set; }

Property Value

System.Nullable<System.Boolean>

Sublayer.PopupTemplate Property

The popup template for the sublayer. When set, the popupTemplate allows users to access attributes and display their values in the view’s popup when the user clicks the image.
Sublayers with a RasterDataSource cannot be queried and therefore do not support PopupTemplate.
Alternatively, a default popup template may be automatically used if Popup.defaultPopupTemplateEnabled is set to true.

public dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate? PopupTemplate { get; set; }

Property Value

PopupTemplate

Sublayer.Renderer Property

The renderer to apply to the sublayer. This value overrides the renderer read from the map service. To see if you can use this property, check the supportsDynamicLayers property of MapImageLayer.capabilities.

public dymaptic.GeoBlazor.Core.Components.Renderers.Renderer? Renderer { get; set; }

Property Value

Renderer

Sublayer.Source Property

An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See DynamicMapLayer for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see DynamicDataLayer.

public dymaptic.GeoBlazor.Core.Components.Layers.DynamicLayer? Source { get; set; }

Property Value

DynamicLayer

Sublayer.SourceJSON Property

The map service’s metadata JSON exposed by the ArcGIS REST API. While most commonly used properties are exposed on the Sublayer class directly, this property gives access to all information returned by the map service. This property is useful if working in an application built using an older version of the API which requires access to map service properties from a more recent version.

public string? SourceJSON { get; set; }

Property Value

System.String

Sublayer.SublayerId Property

The sublayer’s layer ID. When a source is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a DynamicDataLayer or a MapDataLayer and adding it to the source property of the sublayer, the value of this property can be anything set by the developer.

public System.Nullable<int> SublayerId { get; set; }

Property Value

System.Nullable<System.Int32>

Remarks

This maps to the ArcGIS sublayer.id property.

Sublayer.Sublayers Property

If a sublayer contains sublayers, this property is a Collection of Sublayer objects belonging to the given sublayer with sublayers.

public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.Layers.Sublayer> Sublayers { get; set; }

Property Value

System.Collections.Generic.IReadOnlyList<Sublayer>

Sublayer.Title Property

The title of the sublayer used to identify it in places such as the LayerList and Legend widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer.

public string? Title { get; set; }

Property Value

System.String

Sublayer.TypeIdField Property

The name of the field holding the type ID or subtypes for the features. See ArcGIS Pro subtypes document. This property is only available after the Sublayer has been loaded.

public string? TypeIdField { get; set; }

Property Value

System.String

Sublayer.Types Property

An array of types defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. This property is only available after the Sublayer has been loaded.

public dymaptic.GeoBlazor.Core.Components.Layers.FeatureType[]? Types { get; set; }

Property Value

FeatureType[]

Sublayer.Url Property

The URL to the REST endpoint of the sublayer. This allows you to view the schema of fields and query tables located in registered workspaces.

public string? Url { get; set; }

Property Value

System.String

Methods

Sublayer.Refresh() Method

Provides a way to externally call StateHasChanged on the component.

public override void Refresh();

Sublayer.RegisterChildComponent(MapComponent) Method

Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.

public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The calling, child component to register

Returns

System.Threading.Tasks.Task

Exceptions

InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.

Remarks

This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.

Sublayer.UnregisterChildComponent(MapComponent) Method

Undoes the “Registration” of a child with its parent.

public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The child to unregister

Returns

System.Threading.Tasks.Task

Remarks

This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.

Sublayer.UpdateFromJavaScript(Sublayer) Method

Copies values when returning from ArcGIS JavaScript. For internal use only.

public void UpdateFromJavaScript(dymaptic.GeoBlazor.Core.Components.Layers.Sublayer renderedSublayer);

Parameters

renderedSublayer Sublayer