MapControl Class
A Map Control to display raster and vector maps. Supports both popular map services (Bing Maps and OpenStreetMap) and custom map data servers inside your corporate network.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v25.1.dll
NuGet Package: DevExpress.Wpf.Map
#Declaration
[DXLicenseWpf]
public class MapControl :
Control,
IWeakEventListener,
IMapView,
IMapViewCore,
ICoordinateSystemProvider,
IPrintableControl,
IInvalidKeyPanelHolder,
IUnitConverterProvider,
IMapCommandExecutor,
IItemVisibilityCalculatorProvider,
ISupportZooming,
INavigationOptionsProvider
#Related API Members
The following members return MapControl objects:
#Remarks
The DevExpress Map control provides all the functionality required to embed popular map services into your WPF applications. You are free to choose from any existing map data resource (like Bing Maps or OpenStreetMap) or establish your own map data server inside your corporate network.
In addition to using raster map images, you can also utilize vector elements of any shape, stored either in Shapefiles or other formats. The control has built-in navigation elements, supports animated zooming, element highlighting and much more.
The following image demonstrates a MapControl.
To get acquainted with using the MapControl, please refer to the Getting Started section.
#Example
This example demonstrates how to connect to the Bing Maps web service using the BingMapDataProvider
object.
Important
On May 21, 2024, Microsoft announced that Bing Maps for Enterprise and its API will be discontinued. Azure Maps will be a single unified enterprise mapping platform available from Microsoft.
To obtain and display map data from Azure Maps, we implemented the following providers:
- Azure
Map Data Provider - Azure
Search Data Provider - Azure
Route Data Provider - Azure
Geocode Data Provider - Azure
Traffic Incident Data Provider - Azure
Route Isochrone Data Provider
For information on how to migrate your app from Bing Maps to Azure Maps, see the following help topic: DevExpress Map Control for WPF: Migrate from Bing Maps to Azure Maps.
If you already have a Bing Maps for Enterprise license, you can keep using the current API. You must transition to the new API by June 30, 2025 (for free/basic licenses) or June 30, 2028 (for enterprise licenses). New licenses will no longer be available after June 30, 2025. Bing Maps will not work with our map controls without a license after that date.
<Window xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
x:Class="Wpf_MapControl_Lesson1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dxm:MapControl CenterPoint="45,18" ZoomLevel="4" >
<dxm:MapControl.MiniMap>
<dxm:MiniMap Alignment="TopRight">
<dxm:MiniMap.Behavior>
<dxm:FixedMiniMapBehavior CenterPoint="45, 18"/>
</dxm:MiniMap.Behavior>
<dxm:MiniMapImageTilesLayer>
<dxm:BingMapDataProvider BingKey="YOUR BING KEY"/>
</dxm:MiniMapImageTilesLayer>
</dxm:MiniMap>
</dxm:MapControl.MiniMap>
<dxm:ImageLayer>
<dxm:ImageLayer.DataProvider>
<dxm:BingMapDataProvider BingKey="YOUR BING KEY"/>
</dxm:ImageLayer.DataProvider>
</dxm:ImageLayer>
</dxm:MapControl>
</Grid>
</Window>
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the MapControl class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.