Skip to main content
A newer version of this page is available. .

ProjectionBase Class

The base class for all projections used in the MapControl.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v18.1.dll

Declaration

public abstract class ProjectionBase :
    ICoordPointToMapUnitConverter

Remarks

For more information, see Geographical Projections.

Example

This example shows how to get a Hammer-Aitoff map projection for the shapes loaded from the Shapefiles (Countries.shp, Countries.dbf).

To create a custom map projection, do the following:

using System;
using System.Windows.Forms;
using DevExpress.XtraMap;

namespace CustomProjection {
    public partial class Form1 : Form {
        const string filepath = "../../Data/Countries.shp";

        GeoMapCoordinateSystem CoordinateSystem {
            get { return (GeoMapCoordinateSystem)mapControl1.CoordinateSystem; }
        }

        VectorItemsLayer MapLayer {
            get { return (VectorItemsLayer)mapControl1.Layers["MapLayer"]; }
        }

        ShapefileDataAdapter Adapter {
            get { return (ShapefileDataAdapter)MapLayer.Data; }
        }

        public Form1() {
            InitializeComponent();
            CoordinateSystem.Projection = new HammerAitoffProjection();

            Uri baseUri = new Uri(System.Reflection.Assembly.GetEntryAssembly().Location);
            Adapter.FileUri = new Uri(baseUri, filepath);
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the ProjectionBase 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.

See Also