ProjectionBase.GeoToKilometersSize(GeoPoint, MapSize) Method

Converts the geographical size to kilometers.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v21.1.dll


public abstract MapSize GeoToKilometersSize(
    GeoPoint anchorPoint,
    MapSize size


Name Type Description
anchorPoint GeoPoint

A GeoPoint object containing geographical coordinates on which the conversion depends.

size MapSize

A MapSize object, that is the size in geographical coordinates.


Type Description

A MapSize object, that is the size in kilometers.


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:

View Example

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() {
            CoordinateSystem.Projection = new HammerAitoffProjection();

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