wpf-113976-controls-and-libraries-map-control-examples-vector-data-customize-data-appearance-how-to-load-a-vector-cartesian-map.md
To load a vector Cartesian map, do the following.
using System.Windows;
using DevExpress.Xpf.Map;
namespace CartesianMap {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
private void VectorLayer_DataLoaded(object sender, DataLoadedEventArgs e) {
mapControl.ZoomToFitLayerItems();
}
}
}
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
x:Class="CartesianMap.MainWindow"
Title="MainWindow" Height="720" Width="1280">
<Grid>
<dxm:MapControl x:Name="mapControl">
<dxm:MapControl.CoordinateSystem>
<dxm:CartesianMapCoordinateSystem/>
</dxm:MapControl.CoordinateSystem>
<dxm:VectorLayer DataLoaded="VectorLayer_DataLoaded">
<dxm:ShapefileDataAdapter FileUri="Data/Hotel1.shp">
<dxm:ShapefileDataAdapter.SourceCoordinateSystem>
<dxm:CartesianSourceCoordinateSystem/>
</dxm:ShapefileDataAdapter.SourceCoordinateSystem>
</dxm:ShapefileDataAdapter>
</dxm:VectorLayer>
</dxm:MapControl>
</Grid>
</Window>
Imports System.Windows
Imports DevExpress.Xpf.Map
Namespace CartesianMap
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
Private Sub VectorLayer_DataLoaded(ByVal sender As Object, ByVal e As DataLoadedEventArgs)
mapControl.ZoomToFitLayerItems()
End Sub
End Class
End Namespace