Skip to main content
All docs
V25.1
  • IMapMarker Interface

    Defines a map marker’s settings.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public interface IMapMarker

    The following members return IMapMarker objects:

    Remarks

    When a user clicks a map marker, the MarkerClick event fires. The event argument’s Marker property implements the IMapMarker interface.

    Use the MarkerId property to identify the clicked marker and the Location property to get the marker location.

    Run Demo: Map Markers

    <DxMap Provider="MapProvider.Azure"
           Zoom="18"
           Width="950px"
           Height="400px"
           MarkerClick="OnMapMarkerClick" >
        <DxMapApiKeys Azure="@MapApiKeyProvider.GetAzureProviderKey()" />
        <DxMapMarkers>
            <DxMapMarker MarkerId="BusStation" IconUrl="images/bus-station-mark.png" >
                <DxMapMarkerLocation GeoPosition="51.481633,-0.008281" />
            </DxMapMarker>
            <DxMapMarker MarkerId="GiftShop" IconUrl="images/shop-mark.png">
                <DxMapMarkerLocation GeoPosition="51.480889,-0.009259" />
            </DxMapMarker>
        </DxMapMarkers>
        <DxMapRoutes>
            <DxMapRoute Color="red" Weight="9" Mode="MapRouteMode.Walking">
                <DxMapRouteLocations>
                    <DxMapRouteLocation GeoPosition="51.481633,-0.008281" />
                    <DxMapRouteLocation GeoPosition="51.481186,-0.009107" />
                    <DxMapRouteLocation GeoPosition="51.480889,-0.009259" />
                </DxMapRouteLocations>
            </DxMapRoute>
        </DxMapRoutes>
    </DxMap>
    @code {
        void OnMapMarkerClick(MapMarkerClickEventArgs e) {
            switch(e.Marker.MarkerId) {
                case "BusStation":
                    ShowBusStationInformation();
                    break;
                case "GiftShop":
                    ShowShopInformation();
                    break;
            }
        }
        // ...
    }
    

    Map - Icon Url

    Run Demo: Map Markers

    See Also