New to Telerik UI for WinFormsStart a free 30-day trial

SeaLevel ElevationType

Updated over 6 months ago

Please note that Bing Maps will be deprecated effective June 30, 2025. As an alternative, users can refer to the SDK example available in our GitHub repository, which demonstrates how to create a custom provider using the Azure Maps API. A valid Azure Maps subscription key is required to use this functionality.

ElevationType.SeaLevel ElevationRequest gets the offset of the geoid sea level Earth model from the ellipsoid Earth model at a set of latitude and longitude coordinates.

Figure 1: SeaLevel ElevationRequest

WinForms RadMap SeaLevel ElevationRequest

SeaLevel ElevationType request

C#
    
public void SetupSeaLevelElevation()
{ 
    //add pins to the map 
    Telerik.WinControls.UI.Map.PointG point1 = new Telerik.WinControls.UI.Map.PointG(36.114647, -115.172813);
    Telerik.WinControls.UI.Map.PointG point2 = new Telerik.WinControls.UI.Map.PointG(34.05223, -118.24368);
    Telerik.WinControls.UI.Map.PointG point3 = new Telerik.WinControls.UI.Map.PointG(37.77493, -122.41942);
    MapPin pin1 = new MapPin(point1);
    MapPin pin2 = new MapPin(point2);
    MapPin pin3 = new MapPin(point3);
    MapLayer pinsLayer = new MapLayer("Pins");
    this.radMap1.Layers.Add(pinsLayer);
    
    MapLayer calloutsLayer = new MapLayer("Callouts");
    this.radMap1.Layers.Add(calloutsLayer);
    this.radMap1.Layers["Pins"].Add(pin1);
    this.radMap1.Layers["Pins"].Add(pin2);
    this.radMap1.Layers["Pins"].Add(pin3);
    ElevationRequest boundsRequest = new ElevationRequest();
    boundsRequest.ElevationType = ElevationType.SeaLevel;
    boundsRequest.Points.Add(point1);
    boundsRequest.Points.Add(point2);
    boundsRequest.Points.Add(point3);
    
    BingRestMapProvider bingProvider = this.radMap1.Providers[0] as BingRestMapProvider;
    bingProvider.CalculateElevationCompleted += BingProviderBounds_CalculateSeaLevelElevationCompleted;
    bingProvider.CalculateElevationAsync(boundsRequest);
}
    
private void BingProviderBounds_CalculateSeaLevelElevationCompleted(object sender, ElevationCompletedEventArgs e)
{
    for (int i = 0; i < this.radMap1.Layers["Pins"].Overlays.Count; i++)
    {
        MapPin pin = this.radMap1.Layers["Pins"].Overlays[i] as MapPin;
            
        if (pin != null)
        {
            MapCallout callout = new MapCallout(pin);
            callout.MaxWidth = 35;
            callout.Text = e.SeaLevels[0].Offsets[i].ToString() + "m";
            this.radMap1.Layers["Callouts"].Add(callout);
        }
    }
}

See Also

In this article
See Also
Not finding the help you need?
Contact Support