Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenGoogleMap

    RadzenGoogleMap component.

    Inheritance
    System.Object
    RadzenComponent
    RadzenGoogleMap
    Implements
    IDisposable
    Inherited Members
    RadzenComponent.Attributes
    RadzenComponent.Element
    RadzenComponent.MouseEnter
    RadzenComponent.MouseLeave
    RadzenComponent.ContextMenu
    RadzenComponent.Culture
    RadzenComponent.DefaultCulture
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.OnContextMenu(Microsoft.AspNetCore.Components.Web.MouseEventArgs)
    RadzenComponent.Style
    RadzenComponent.Visible
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, Int32)
    RadzenComponent.UniqueID
    RadzenComponent.JSRuntime
    RadzenComponent.IsJSRuntimeAvailable
    RadzenComponent.OnInitialized()
    RadzenComponent.SetParametersAsync(ParameterView)
    RadzenComponent.Reference
    RadzenComponent.RaiseContextMenu(Microsoft.AspNetCore.Components.Web.MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.RaiseMouseLeave()
    RadzenComponent.CurrentStyle
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenGoogleMap : RadzenComponent, IDisposable
    Examples
    <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}");
      }
    }

    Properties

    ApiKey

    Gets or sets the Google API key.

    Declaration
    public string ApiKey { get; set; }
    Property Value
    Type Description
    System.String

    The Google API key.

    Center

    Gets or sets the center map position.

    Declaration
    public GoogleMapPosition Center { get; set; }
    Property Value
    Type Description
    GoogleMapPosition

    The center.

    Data

    Gets or sets the data - collection of RadzenGoogleMapMarker.

    Declaration
    public IEnumerable<RadzenGoogleMapMarker> Data { get; set; }
    Property Value
    Type Description
    IEnumerable<RadzenGoogleMapMarker>

    The data.

    FitBoundsToMarkersOnUpdate

    Flag indicating whether map will be zoomed to marker bounds on update or not.

    Declaration
    public bool FitBoundsToMarkersOnUpdate { get; set; }
    Property Value
    Type Description
    System.Boolean

    MapClick

    Gets or sets the map click callback.

    Declaration
    public EventCallback<GoogleMapClickEventArgs> MapClick { get; set; }
    Property Value
    Type Description
    EventCallback<GoogleMapClickEventArgs>

    The map click callback.

    MapId

    Gets or sets the Google Map Id.

    Declaration
    public string MapId { get; set; }
    Property Value
    Type Description
    System.String

    The Google Map Id.

    MarkerClick

    Gets or sets the marker click callback.

    Declaration
    public EventCallback<RadzenGoogleMapMarker> MarkerClick { get; set; }
    Property Value
    Type Description
    EventCallback<RadzenGoogleMapMarker>

    The marker click callback.

    Markers

    Gets or sets the markers.

    Declaration
    public RenderFragment Markers { get; set; }
    Property Value
    Type Description
    RenderFragment

    The markers.

    Options

    Gets or sets the Google map options: https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.

    Declaration
    public Dictionary<string, object> Options { get; set; }
    Property Value
    Type Description
    Dictionary<System.String, System.Object>

    The Google map options.

    Zoom

    Gets or sets the zoom.

    Declaration
    public double Zoom { get; set; }
    Property Value
    Type Description
    System.Double

    The zoom.

    Methods

    AddMarker(RadzenGoogleMapMarker)

    Adds the marker.

    Declaration
    public void AddMarker(RadzenGoogleMapMarker marker)
    Parameters
    Type Name Description
    RadzenGoogleMapMarker marker

    The marker.

    Dispose()

    Detaches event handlers and disposes Reference.

    Declaration
    public override void Dispose()
    Overrides
    RadzenComponent.Dispose()

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    System.String
    Overrides
    RadzenComponent.GetComponentCssClass()

    OnAfterRenderAsync(Boolean)

    Called by the Blazor runtime.

    Declaration
    protected override async Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender
    Returns
    Type Description
    Task
    Overrides
    RadzenComponent.OnAfterRenderAsync(Boolean)

    OnMapClick(GoogleMapClickEventArgs)

    Handles the MapClick event.

    Declaration
    public async Threading.Tasks.Task OnMapClick(GoogleMapClickEventArgs args)
    Parameters
    Type Name Description
    GoogleMapClickEventArgs args

    The GoogleMapClickEventArgs instance containing the event data.

    Returns
    Type Description
    System.Threading.Tasks.Task

    OnMarkerClick(RadzenGoogleMapMarker)

    Called when marker click.

    Declaration
    public async Threading.Tasks.Task OnMarkerClick(RadzenGoogleMapMarker marker)
    Parameters
    Type Name Description
    RadzenGoogleMapMarker marker

    The marker.

    Returns
    Type Description
    System.Threading.Tasks.Task

    RemoveMarker(RadzenGoogleMapMarker)

    Removes the marker.

    Declaration
    public void RemoveMarker(RadzenGoogleMapMarker marker)
    Parameters
    Type Name Description
    RadzenGoogleMapMarker marker

    The marker.

    Implements

    IDisposable

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT