Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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

DxMapCenter Class

Defines location that is displayed at the component’s center.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public class DxMapCenter :
    DxMapLocation<MapLocationModel>

#Remarks

Use the DxMapCenter object to specify a location that should be displayed in the center of the DxMap component. This setting is useful when automatic map adjustment is not available, namely in the following cases:

  • Automatic adjustment is disabled (the AutoAdjust property is set to false).
  • The component displays a static Google image (the Provider property is set to GoogleStatic).
  • The map does not contain markers or routes.

Note that the component can change the specified location if the AutoAdjust property is set to true (the default value).

You can specify location settings in two ways:

  • Use the GeoPosition property that accepts coordinates and text address.

    razor
    <DxMap Zoom="14" Provider="MapProvider.Azure" Width="950px" Height="400px" >
        <DxMapApiKeys Azure="@MapApiKeyProvider.GetAzureProviderKey()" />
        <DxMapCenter GeoPosition="40.7061, -73.9969" />
    </DxMap>
    
  • Use Latitude and Longitude properties.

    razor
    <DxMap Zoom="14" Provider="MapProvider.Azure" Width="950px" Height="400px" >
        <DxMapApiKeys Azure="@MapApiKeyProvider.GetAzureProviderKey()" />
        <DxMapCenter Latitude="40.7061" Longitude="-73.9969"/>
    </DxMap>
    

Run Demo: Map - Overview

#Inheritance

Object
ComponentBase
DxSettingsComponent<DevExpress.Blazor.ClientComponents.Internal.MapLocationModel>
DxMapLocation<DevExpress.Blazor.ClientComponents.Internal.MapLocationModel>
DxMapCenter
See Also