layout: default title: GraphicsLayer parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Layers

GraphicsLayer Class

A GraphicsLayer contains one or more client-side Graphics. Each graphic in the GraphicsLayer is rendered in a
LayerView inside either a SceneView or a MapView. The graphics contain discrete vector geometries that represent
real-world phenomena.
ArcGIS Maps SDK for JavaScript

public class GraphicsLayer : dymaptic.GeoBlazor.Core.Components.Layers.Layer

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Layer 🡒 GraphicsLayer

Constructors

GraphicsLayer() Constructor

Parameterless constructor for use as a razor component

public GraphicsLayer();

GraphicsLayer(IReadOnlyCollection, string, Nullable, Nullable, Nullable) Constructor

Constructor for use in code

public GraphicsLayer(System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Layers.Graphic>? graphics=null, string? title=null, System.Nullable<double> opacity=null, System.Nullable<bool> visible=null, System.Nullable<dymaptic.GeoBlazor.Core.Components.Layers.ListMode> listMode=null);

Parameters

graphics System.Collections.Generic.IReadOnlyCollection<Graphic>

A collection of Graphics in the layer.

title System.String

The title of the layer used to identify it in places such as the Legend and LayerList widgets.

opacity System.Nullable<System.Double>

The opacity of the layer.

visible System.Nullable<System.Boolean>

Indicates if the layer is visible in the View. When false, the layer may still be added to a Map instance that is
referenced in a view, but its features will not be visible in the view.

listMode System.Nullable<ListMode>

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

Properties

GraphicsLayer.Graphics Property

A collection of Graphics in the layer.

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

Property Value

System.Collections.Generic.IReadOnlyCollection<Graphic>

GraphicsLayer.LayerType Property

Used internally to identify the sub type of Layer

public override string LayerType { get; }

Property Value

System.String

Methods

GraphicsLayer.Add(Graphic) Method

Add a graphic to the current layer

public System.Threading.Tasks.Task Add(dymaptic.GeoBlazor.Core.Components.Layers.Graphic graphic);

Parameters

graphic Graphic

The graphic to add

Returns

System.Threading.Tasks.Task

GraphicsLayer.Add(IEnumerable, CancellationToken) Method

Adds a collection of graphics to the graphics layer

public System.Threading.Tasks.Task Add(System.Collections.Generic.IEnumerable<dymaptic.GeoBlazor.Core.Components.Layers.Graphic> graphics, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

graphics System.Collections.Generic.IEnumerable<Graphic>

The graphics to add

cancellationToken System.Threading.CancellationToken

A CancellationToken to cancel the operation

Returns

System.Threading.Tasks.Task

GraphicsLayer.Clear() Method

Removes all graphics from the current layer

public System.Threading.Tasks.Task Clear();

Returns

System.Threading.Tasks.Task

GraphicsLayer.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.

GraphicsLayer.RegisterExistingGraphicsFromJavaScript(IEnumerable) Method

Registers a set of graphics that were created from JavaScript

public void RegisterExistingGraphicsFromJavaScript(System.Collections.Generic.IEnumerable<dymaptic.GeoBlazor.Core.Components.Layers.Graphic> graphics);

Parameters

graphics System.Collections.Generic.IEnumerable<Graphic>

GraphicsLayer.Remove(Graphic) Method

Remove a graphic from the current layer

public System.Threading.Tasks.Task Remove(dymaptic.GeoBlazor.Core.Components.Layers.Graphic graphic);

Parameters

graphic Graphic

The graphic to remove

Returns

System.Threading.Tasks.Task

GraphicsLayer.Remove(IEnumerable) Method

Removes a set of graphics from the current layer

public System.Threading.Tasks.Task Remove(System.Collections.Generic.IEnumerable<dymaptic.GeoBlazor.Core.Components.Layers.Graphic> graphics);

Parameters

graphics System.Collections.Generic.IEnumerable<Graphic>

The graphics to remove

Returns

System.Threading.Tasks.Task

GraphicsLayer.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.