Back to Devexpress

CartesianMapCoordinateSystem Class

wpf-devexpress-dot-xpf-dot-map-d7cd6a84.md

latest4.9 KB
Original Source

CartesianMapCoordinateSystem Class

This class allows use of the Cartesian coordinate system for the Map Control.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public class CartesianMapCoordinateSystem :
    MapCoordinateSystem
vb
Public Class CartesianMapCoordinateSystem
    Inherits MapCoordinateSystem

Remarks

An object of the CartesianMapCoordinateSystem class can be assigned to the MapControl.CoordinateSystem property.

Example

To load a vector Cartesian map, do the following.

  1. Crete a ShapefileDataAdapter object.
  2. Set its CoordinateSystemDataAdapterBase.SourceCoordinateSystem property to a CartesianSourceCoordinateSystem object.
  3. Specify its ShapefileDataAdapter.FileUri property.
  4. Assign this object to the VectorLayer.Data property.
csharp
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();
        }
    }
}
xaml
<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>
vb
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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CartesianMapCoordinateSystem 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.

wpf-map-load-vector-cartesian-data/CS/MapLesson2/MainWindow.xaml#L24

xml
<dxm:MapControl.CoordinateSystem>
    <dxm:CartesianMapCoordinateSystem/>
</dxm:MapControl.CoordinateSystem>

Inheritance

Object DispatcherObject DependencyObject Freezable MapDependencyObject MapCoordinateSystem CartesianMapCoordinateSystem

See Also

CartesianMapCoordinateSystem Members

DevExpress.Xpf.Map Namespace