Skip to main content Link Menu Expand (external link) Document Search Copy Copied

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
  
JS API

</a>

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) 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);

Parameters

graphics System.Collections.Generic.IEnumerable<Graphic>

The graphics to add

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.OnAfterRenderAsync(System.Boolean) 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.

GraphicsLayer.RegisterExistingGraphicFromJavaScript(Graphic) Method

Register a graphic that was created in JavaScript

public void RegisterExistingGraphicFromJavaScript(dymaptic.GeoBlazor.Core.Components.Layers.Graphic graphic);

Parameters

graphic 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

GraphicsLayer.ValidateRequiredChildren() Method

When a MapView is prepared to render, this will check to make sure that all properties with the
RequiredPropertyAttribute are provided.

public override void ValidateRequiredChildren();

Exceptions

MissingRequiredChildElementException
The consumer needs to provide the missing child component

MissingRequiredOptionsChildElementException
The consumer needs to provide ONE of the options of child components