Skip to content

MarkerOverlay

Namespace: ThinkGeo.UI.Blazor

Provides the base functionality for overlays that display markers on a map.

public abstract class MarkerOverlay : Overlay, Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleEvent, Microsoft.AspNetCore.Components.IHandleAfterRender, System.IDisposable, System.IAsyncDisposable

Inheritance object → ComponentBase → Overlay → MarkerOverlay
Implements IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IAsyncDisposable

Properties

EnableSelection

Enables OpenLayers marker selection. Ctrl-click toggles the first hit, Ctrl-drag adds markers whose positions lie in the box, and Ctrl+Shift-drag removes them. Defaults to false. Selection survives extent refreshes; disabling selection or removing the overlay clears it.

public bool EnableSelection { get; set; }

Property Value

bool

OnSelectionChanged

Occurs when the selected marker IDs change in this overlay.

public EventCallback<MarkerSelectionChangedEventArgs> OnSelectionChanged { get; set; }

Property Value

EventCallback<MarkerSelectionChangedEventArgs>

IsVisible

public bool IsVisible { get; set; }

Property Value

bool

OnClick

Occurs when the user clicks a marker that belongs to this overlay.

public EventCallback<ClickedMarkerOverlayEventArgs> OnClick { get; set; }

Property Value

EventCallback<ClickedMarkerOverlayEventArgs>

OnMouseOut

Occurs when the pointer leaves a marker that belongs to this overlay.

public EventCallback<MouseOutMarkerOverlayEventArgs> OnMouseOut { get; set; }

Property Value

EventCallback<MouseOutMarkerOverlayEventArgs>

OnMouseOver

Occurs when the pointer enters a marker that belongs to this overlay.

public EventCallback<MouseOverMarkerOverlayEventArgs> OnMouseOver { get; set; }

Property Value

EventCallback<MouseOverMarkerOverlayEventArgs>

Id

Gets or sets the unique identifier used to register this overlay with the map. Defaults to a new GUID.

public string Id { get; set; }

Property Value

string

Constructors

MarkerOverlay()

Initializes a new instance of the MarkerOverlay class.

public MarkerOverlay()

Methods

ClearSelectionAsync()

Clears this overlay's selection in OpenLayers and raises OnSelectionChanged when necessary.

public Task ClearSelectionAsync()

Returns

Task

GetMarkers(RectangleShape, int)

Returns a collection of markers for the supplied extent and zoom level./>.

public Collection<Marker> GetMarkers(RectangleShape worldExtent, int currentZoomLevelId)

Parameters

worldExtent RectangleShape
World extent used to determine which markers to include.

currentZoomLevelId int
Current zoom level identifier supplied by the client.

Returns

Collection<Marker>
A collection of markers that the overlay will render on the client.

RedrawAsync()

Requests that the overlay redraw its marker layer on the client. Throws when the overlay has not finished initializing.

public Task RedrawAsync()

Returns

Task
A task that completes once the redraw request is dispatched.

SetParametersAsync(ParameterView)

Resets the pending-change tracking flag before applying new parameters.

public Task SetParametersAsync(ParameterView parameters)

Parameters

parameters ParameterView
Incoming set of parameters supplied by the framework.

Returns

Task
A task that completes when the base implementation finishes processing.

A(Marker)

internal void A(Marker )

Parameters

`` Marker

Returns

void

InitializeAsyncCore()

Ensures the JavaScript representation of the overlay is created on first render.

protected Task InitializeAsyncCore()

Returns

Task
A task that completes once the overlay has been added to the client map.

ReleaseAsyncCore()

Removes the client-side marker layer and releases base overlay resources.

protected Task ReleaseAsyncCore()

Returns

Task
A task that completes when the client-side layer has been removed.

GetMarkersCore(RectangleShape, int)

When implemented in a derived class, returns the markers that should be rendered for the supplied extent and zoom level.

protected abstract Collection<Marker> GetMarkersCore(RectangleShape worldExtent, int zoomLevel)

Parameters

worldExtent RectangleShape
World extent used to determine which markers to include.

zoomLevel int
Current zoom level identifier supplied by the client.

Returns

Collection<Marker>
A collection of markers that the overlay will render on the client.

OnAfterRenderAsync(bool)

Applies pending configuration changes to the client before running the base lifecycle logic.

protected Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool
Indicates whether this is the first render of the component.

Returns

Task
A task that completes when client updates and base processing have finished.

OnInitialized()

Registers the overlay with the parent map view before rendering begins.

protected void OnInitialized()

Returns

void

ShouldRender()

Determines whether the component requires re-rendering. Marker overlays render only when pending changes exist.

protected bool ShouldRender()

Returns

bool
true when pending updates must be applied; otherwise, false.

a(Marker)

internal bool a(Marker )

Parameters

`` Marker

Returns

bool

B(Marker)

internal void B(Marker )

Parameters

`` Marker

Returns

void