layout: default title: Graphic parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Layers

Graphic Class

A Graphic is a vector representation of real world geographic phenomena. It can contain geometry, a symbol, and
attributes. A Graphic is displayed in the GraphicsLayer.
ArcGIS Maps SDK for JavaScript

public class Graphic : dymaptic.GeoBlazor.Core.Components.Layers.LayerObject

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 LayerObject 🡒 Graphic

Constructors

Graphic() Constructor

Parameterless constructor for using as a razor component

public Graphic();

Graphic(Geometry, Symbol, PopupTemplate, AttributesDictionary, Nullable, string) Constructor

Constructs a new Graphic in code with parameters

public Graphic(dymaptic.GeoBlazor.Core.Components.Geometries.Geometry? geometry=null, dymaptic.GeoBlazor.Core.Components.Symbols.Symbol? symbol=null, dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate? popupTemplate=null, dymaptic.GeoBlazor.Core.Objects.AttributesDictionary? attributes=null, System.Nullable<bool> visible=null, string? legendLabel=null);

Parameters

geometry Geometry

The geometry that defines the graphic’s location.

symbol Symbol

The Symbol for the object.

popupTemplate PopupTemplate

The PopupTemplate for displaying content in a Popup when the graphic is selected.

attributes AttributesDictionary

Name-value pairs of fields and field values associated with the graphic.

visible System.Nullable<System.Boolean>

Indicates the visibility of the graphic.

legendLabel System.String

Optional label override for this graphic in the GeoBlazor Pro GraphicsLegendWidget.

Properties

Graphic.Attributes Property

Name-value pairs of fields and field values associated with the graphic.

public dymaptic.GeoBlazor.Core.Objects.AttributesDictionary Attributes { get; set; }

Property Value

AttributesDictionary

Remarks

This collection should only be set via the constructor or as a markup parameter/attribute. To add or remove
members, use the methods defined in AttributesDictionary

Graphic.Geometry Property

The geometry that defines the graphic’s location.

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

Property Value

Geometry

Remarks

To retrieve a current geometry for a graphic, use GetGeometry() instead of calling this Property
directly.

Graphic.LayerId Property

The GeoBlazor Id of the parent layer, used when serializing the graphic to/from JavaScript.

public System.Nullable<System.Guid> LayerId { get; set; }

Property Value

System.Nullable<System.Guid>

Graphic.LegendLabel Property

Legend label override for this graphic in the GeoBlazor Pro Graphics Legend Widget.
Supports attribute substitution using the syntax {attributeName}.

public string? LegendLabel { get; set; }

Property Value

System.String

Graphic.PopupTemplate Property

The PopupTemplate for displaying content in a Popup when the graphic is selected.

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

Property Value

PopupTemplate

Remarks

To retrieve a current popup template for a graphic, use GetPopupTemplate() instead of calling this
Property directly.

Methods

Graphic.DisposeAsync() Method

Implements the IAsyncDisposable pattern.

public override System.Threading.Tasks.ValueTask DisposeAsync();

Implements DisposeAsync()

Returns

System.Threading.Tasks.ValueTask

Graphic.GetGeometry() Method

Retrieves the Geometry from the rendered graphic.

public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Geometry?> GetGeometry();

Returns

System.Threading.Tasks.Task<Geometry>

Graphic.GetPopupTemplate() Method

Retrieves the PopupTemplate from the rendered graphic.

public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate?> GetPopupTemplate();

Returns

System.Threading.Tasks.Task<PopupTemplate>

Graphic.GetSymbol() Method

Gets the current Symbol for the object.

public override System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Symbols.Symbol?> GetSymbol();

Returns

System.Threading.Tasks.Task<Symbol>

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

Graphic.SetGeometry(Geometry) Method

Sets the Geometry on the rendered graphic.

public System.Threading.Tasks.Task SetGeometry(dymaptic.GeoBlazor.Core.Components.Geometries.Geometry geometry);

Parameters

geometry Geometry

Returns

System.Threading.Tasks.Task

Graphic.SetParametersAsync(ParameterView) Method

Sets parameters supplied by the component’s parent in the render tree.

public override System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters);

Parameters

parameters Microsoft.AspNetCore.Components.ParameterView

The parameters.

Implements SetParametersAsync(ParameterView)

Returns

System.Threading.Tasks.Task
A System.Threading.Tasks.Task that completes when the component has finished updating and rendering itself.

Remarks

Parameters are passed when Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView) is called. It is not required that
the caller supply a parameter value for all of the parameters that are logically understood by the component.

The default implementation of Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView) will set the value of each property
decorated with Microsoft.AspNetCore.Components.ParameterAttribute or Microsoft.AspNetCore.Components.CascadingParameterAttribute that has
a corresponding value in the Microsoft.AspNetCore.Components.ParameterView. Parameters that do not have a corresponding value
will be unchanged.

Graphic.SetPopupTemplate(PopupTemplate) Method

Sets the PopupTemplate on the rendered graphic.

public System.Threading.Tasks.Task SetPopupTemplate(dymaptic.GeoBlazor.Core.Components.Popups.PopupTemplate popupTemplate);

Parameters

popupTemplate PopupTemplate

The PopupTemplate for displaying content in a Popup when the graphic is selected.

Returns

System.Threading.Tasks.Task

Graphic.SetSymbol(Symbol) Method

Sets the Symbol for the object.

public override System.Threading.Tasks.Task SetSymbol(dymaptic.GeoBlazor.Core.Components.Symbols.Symbol symbol);

Parameters

symbol Symbol

The Symbol for the object.

Returns

System.Threading.Tasks.Task

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