Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions blazorbootstrap/Components/Maps/GoogleMap.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ protected override async Task OnInitializedAsync()
await base.OnInitializedAsync();
}

/// <summary>
/// Adds a marker to the GoogleMap.
/// </summary>
/// <param name="marker">The marker to add to the map.</param>
/// <returns>A completed task.</returns>
public ValueTask AddMarkerAsync(GoogleMapMarker marker)
{
JSRuntime.InvokeVoidAsync("window.blazorBootstrap.googlemaps.addMarker", Id, marker, objRef);
Expand All @@ -31,13 +36,21 @@ public async Task OnMarkerClickJS(GoogleMapMarker marker)
await OnMarkerClick.InvokeAsync(marker);
}

/// <summary>
/// Refreshes the Google Maps component.
/// </summary>
/// <returns>A completed task.</returns>
public ValueTask RefreshAsync()
{
JSRuntime.InvokeVoidAsync("window.blazorBootstrap.googlemaps.initialize", Id, Zoom, Center, Markers, Clickable, objRef);

return ValueTask.CompletedTask;
}

/// <summary>
/// Updates the markers on the Google Map.
/// </summary>
/// <returns>A completed task.</returns>
public ValueTask UpdateMarkersAsync(IEnumerable<GoogleMapMarker> markers)
{
JSRuntime.InvokeVoidAsync("window.blazorBootstrap.googlemaps.updateMarkers", Id, markers, objRef);
Expand Down
Loading