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

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

</a>

public class Graphic : dymaptic.GeoBlazor.Core.Components.Layers.LayerObject,
System.IEquatable<dymaptic.GeoBlazor.Core.Components.Layers.Graphic>

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

Implements System.IEquatable<Graphic>

Constructors

Graphic() Constructor

Parameterless constructor for using as a razor component

public Graphic();

Graphic(Geometry, Symbol, PopupTemplate, Dictionary<string,object>) 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, System.Collections.Generic.Dictionary<string,object>? attributes=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 System.Collections.Generic.Dictionary<System.String,System.Object>

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

Properties

Graphic.Attributes Property

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

public System.Collections.Generic.Dictionary<string,object>? Attributes { get; set; }

Property Value

System.Collections.Generic.Dictionary<System.String,System.Object>

Graphic.DotNetGraphicReference Property

Internally used reference for JavaScript callbacks.

public Microsoft.JSInterop.DotNetObjectReference<dymaptic.GeoBlazor.Core.Components.Layers.Graphic> DotNetGraphicReference { get; }

Property Value

Microsoft.JSInterop.DotNetObjectReference<Graphic>

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.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.Equals(object) Method

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj);

Parameters

obj System.Object

The object to compare with the current object.

Returns

System.Boolean
true if the specified object is equal to the current object; otherwise, false.

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.GetHashCode() Method

Serves as the default hash function.

public override int GetHashCode();

Returns

System.Int32
A hash code for the current object.

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.OnGraphicCreated(IJSObjectReference) Method

Javascript-invokable internal method.

public void OnGraphicCreated(Microsoft.JSInterop.IJSObjectReference jsObjectReference);

Parameters

jsObjectReference Microsoft.JSInterop.IJSObjectReference

The javascript object reference for the rendered graphic.

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

Graphic.RegisterGraphic(IJSObjectReference) Method

Used internally to register a graphic that was generated in Javascript directly.

public System.Threading.Tasks.Task RegisterGraphic(Microsoft.JSInterop.IJSObjectReference jsObjectReference);

Parameters

jsObjectReference Microsoft.JSInterop.IJSObjectReference

Returns

System.Threading.Tasks.Task

Remarks

Not intended for end-user use.

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

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

Operators

Graphic.operator ==(Graphic, Graphic) Operator

Compares two Graphic instances for equality.

public static bool operator ==(dymaptic.GeoBlazor.Core.Components.Layers.Graphic? left, dymaptic.GeoBlazor.Core.Components.Layers.Graphic? right);

Parameters

left Graphic

right Graphic

Returns

System.Boolean

Graphic.operator !=(Graphic, Graphic) Operator

Compares two Graphic instances for inequality.

public static bool operator !=(dymaptic.GeoBlazor.Core.Components.Layers.Graphic? left, dymaptic.GeoBlazor.Core.Components.Layers.Graphic? right);

Parameters

left Graphic

right Graphic

Returns

System.Boolean