RadzenGoogleMap component.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.SetParametersAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenGoogleMap : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender<RadzenGoogleMap Zoom="3" Center=@(new GoogleMapPosition() { Lat = 42.6977, Lng = 23.3219 }) MapClick=@OnMapClick MarkerClick=@OnMarkerClick">
<Markers>
<RadzenGoogleMapMarker Title="London" Label="London" Position=@(new GoogleMapPosition() { Lat = 51.5074, Lng = 0.1278 }) />
<RadzenGoogleMapMarker Title="Paris " Label="Paris" Position=@(new GoogleMapPosition() { Lat = 48.8566, Lng = 2.3522 }) />
</Markers>
</RadzenGoogleMap>
@code {
void OnMapClick(GoogleMapClickEventArgs args)
{
Console.WriteLine($"Map clicked at Lat: {args.Position.Lat}, Lng: {args.Position.Lng}");
}
void OnMarkerClick(RadzenGoogleMapMarker marker)
{
Console.WriteLine($"Map {marker.Title} marker clicked. Marker position -> Lat: {marker.Position.Lat}, Lng: {marker.Position.Lng}");
}
}Gets or sets the Google API key.
public string ApiKey { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the Google API key. |
Gets or sets the center map position.
public GoogleMapPosition Center { get; set; }
| Type | Description |
|---|---|
| GoogleMapPosition | Gets or sets the center map position. |
Gets or sets the data - collection of RadzenGoogleMapMarker.
public IEnumerable<RadzenGoogleMapMarker> Data { get; set; }
| Type | Description |
|---|---|
| IEnumerable<RadzenGoogleMapMarker> | Gets or sets the data - collection of RadzenGoogleMapMarker. |
Flag indicating whether map will be zoomed to marker bounds on update or not.
public bool FitBoundsToMarkersOnUpdate { get; set; }
| Type | Description |
|---|---|
| bool | Flag indicating whether map will be zoomed to marker bounds on update or not. |
Gets or sets the map click callback.
public EventCallback<GoogleMapClickEventArgs> MapClick { get; set; }
| Type | Description |
|---|---|
| EventCallback<GoogleMapClickEventArgs> | Gets or sets the map click callback. |
Gets or sets the Google Map Id.
public string MapId { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the Google Map Id. |
Gets or sets the marker click callback.
public EventCallback<RadzenGoogleMapMarker> MarkerClick { get; set; }
| Type | Description |
|---|---|
| EventCallback<RadzenGoogleMapMarker> | Gets or sets the marker click callback. |
Gets or sets the markers.
public RenderFragment Markers { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the markers. |
Gets or sets the Google map options: https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.
public Dictionary<string, object> Options { get; set; }
| Type | Description |
|---|---|
| Dictionary<string, object> | Gets or sets the Google map options: https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions. |
Gets or sets the zoom.
public double Zoom { get; set; }
| Type | Description |
|---|---|
| double | Gets or sets the zoom. |
Adds the marker.
public void AddMarker(RadzenGoogleMapMarker marker)
| Type | Name | Description |
|---|---|---|
| RadzenGoogleMapMarker | marker | The marker. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
protected override Task OnAfterRenderAsync(bool firstRender)
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
| Type | Description |
|---|---|
| Task |
Handles the MapClick event.
public Task OnMapClick(GoogleMapClickEventArgs args)
| Type | Name | Description |
|---|---|---|
| GoogleMapClickEventArgs | args | The GoogleMapClickEventArgs instance containing the event data. |
| Type | Description |
|---|---|
| Task |
Called when marker click.
public Task OnMarkerClick(RadzenGoogleMapMarker marker)
| Type | Name | Description |
|---|---|---|
| RadzenGoogleMapMarker | marker | The marker. |
| Type | Description |
|---|---|
| Task |
Removes the marker.
public void RemoveMarker(RadzenGoogleMapMarker marker)
| Type | Name | Description |
|---|---|---|
| RadzenGoogleMapMarker | marker | The marker. |