Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    MapClickEventArgs.CurrentLocation Property

    Returns information about the clicked location.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    public IMapLocation CurrentLocation { get; }

    #Property Value

    Type Description
    IMapLocation

    An object that contains location settings.

    #Remarks

    When a user clicks a map, the MapClick event fires. Use the event argument’s CurrentLocation property to get coordinates of the clicked location.

    Run Demo: Map Markers

    Razor
    <DxFormLayout >
        <DxFormLayoutItem Caption="Latitude:" ColSpanMd="6">
            <DxTextBox @bind-Text="@Latitude" />
        </DxFormLayoutItem>
        <DxFormLayoutItem Caption="Longitude:" ColSpanMd="6">
            <DxTextBox @bind-Text="@Longitude" />
        </DxFormLayoutItem>
        <DxFormLayoutItem ColSpanMd="12">
            <DxMap Zoom="14" Provider="MapProvider.Azure" Width="100%" Height="400px" MapClick=@OnMapClick >
                <DxMapApiKeys Azure="@MapApiKeyProvider.GetAzureProviderKey()" />
                <DxMapCenter GeoPosition="40.7061, -73.9969" />
            </DxMap>
        </DxFormLayoutItem>
    </DxFormLayout>
    
    @code {
        string Latitude;
        string Longitude;
    
        void OnMapClick(MapClickEventArgs e) {
            Latitude = e.CurrentLocation.Latitude.ToString("0.######");
            Longitude = e.CurrentLocation.Longitude.ToString("0.######");
        }
    }
    

    Map - Marker Location

    See Also