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
Inheritance Object → ComponentBase → Overlay → MarkerOverlay
Implements IComponent, IHandleEvent, IHandleAfterRender
Properties¶
OnClick¶
Occurs when the user clicks a marker that belongs to this overlay.
public EventCallback<ClickedMarkerOverlayEventArgs> OnClick { get; set; }
Property Value¶
EventCallback<ClickedMarkerOverlayEventArgs>
IsVisible¶
public bool IsVisible { get; set; }
Property Value¶
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¶
Constructors¶
MarkerOverlay()¶
Initializes a new instance of the MarkerOverlay class.
public MarkerOverlay()
Methods¶
GetMarkers(RectangleShape, Int32)¶
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 Int32
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.
AddMarker(Marker)¶
internal void AddMarker(Marker marker)
Parameters¶
marker Marker
InitAsync()¶
Ensures the JavaScript representation of the overlay is created on first render.
protected internal Task InitAsync()
Returns¶
Task
A task that completes once the overlay has been added to the client map.
ReleaseAsync()¶
Removes the client-side marker layer and releases base overlay resources.
protected internal Task ReleaseAsync()
Returns¶
Task
A task that completes when the client-side layer has been removed.
GetMarkersCore(RectangleShape, Int32)¶
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 Int32
Current zoom level identifier supplied by the client.
Returns¶
Collection<Marker>
A collection of markers that the overlay will render on the client.
OnAfterRenderAsync(Boolean)¶
Applies pending configuration changes to the client before running the base lifecycle logic.
protected Task OnAfterRenderAsync(bool firstRender)
Parameters¶
firstRender Boolean
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()
ShouldRender()¶
Determines whether the component requires re-rendering. Marker overlays render only when pending changes exist.
protected bool ShouldRender()
Returns¶
Boolean
true when pending updates must be applied; otherwise, false.