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; }
private void OnElevationsCalculated(object sender, ElevationsCalculatedEventArgs e) { if (e.Cancelled == true || e.Error != null) { return; } if (e.Result.ResultCode != RequestResultCode.Success) { return; } informationLayer.Data.Items.Clear(); // foreach requested location create a new callout with elevation value. foreach (ElevationInformation elevationResult in e.Result.Locations) { informationLayer.Data.Items.Add(new MapCallout { Location = elevationResult.Location, Text = String.Format("Elevation: {0}m.", elevationResult) }); } }