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

ElevationInformation.Elevation Property

Gets or sets the elevation value of the specified geographical point.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v19.2.dll

Declaration

[DefaultValue(0)]
public int Elevation { get; set; }

Property Value

Type Default Description
Int32 0

A Int32 value specifying the elevation expressed in meters.

Remarks

For more information, refer to the Bing Elevation Data topic in MSDN.

Example

This example demonstrates how to receive elevation information from the Bing Maps service.

To do this, request elevation information using the BingElevationDataProvider.RequestPointsElevations method. Then, display the request result using the BingElevationDataProvider.ElevationsCalculated event handler.

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

namespace BingElevationData {
    public partial class Form1 : Form {
        InformationLayer layer { get { return (InformationLayer)mapControl.Layers[1]; } }
        VectorItemsLayer vectorLayer { get { return (VectorItemsLayer)mapControl.Layers[2]; } }
        BingElevationDataProvider provider { get { return (BingElevationDataProvider)layer.DataProvider; } }
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) {
            provider.ElevationsCalculated += OnElevationCalculated;
            provider.GenerateLayerItems = false;
            List<GeoPoint> locations = new List<GeoPoint> {
                new GeoPoint(41.145556, -73.995),
                new GeoPoint(36.131389, -95.937222),
                new GeoPoint(36.175, -115.136389)
            };
            provider.RequestPointsElevations(locations);
        }
        void OnElevationCalculated(object sender, ElevationsCalculatedEventArgs e) {
            MapItemStorage storage = new MapItemStorage();
            foreach (ElevationInformation elevationInformation in e.Result.Locations) {
                storage.Items.Add(new MapCallout() {
                    Text = string.Format("{0}\nElevation = {1} m", elevationInformation.Location, elevationInformation.Elevation),
                    Location = elevationInformation.Location
                });
            }
            vectorLayer.Data = storage;
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Elevation property.

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