Skip to main content

BingLocationInformation.GeocodePoints Property

Gets or sets the collection of geocode points that a Bing Maps Service returns.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v23.2.dll

NuGet Package: DevExpress.Win.Map

Declaration

[DefaultValue(null)]
public BingGeocodePoint[] GeocodePoints { get; set; }

Property Value

Type Default Description
BingGeocodePoint[] null

The collection of geocode points.

Remarks

Use the BingGeocodePoint.CalculationMethod property to determine how the geocode point is calculated. The BingGeocodePoint.UsageType property defines how the geocode point should be used.

The following example uses the GeocodePoints property to get geographical points for the Route and Display locations:

private void searchProvider_SearchCompleted(object sender, BingSearchCompletedEventArgs e) {
  //...
  GeoPoint routeLocation = GetLocation((BingLocationInformation)e.RequestResult.SearchResults[0], BingUsageType.Route);
  GeoPoint displayLocation = GetLocation((BingLocationInformation)e.RequestResult.SearchResults[0], BingUsageType.Display);
}

GeoPoint GetLocation(BingLocationInformation locationInformation, BingUsageType usageType) {
  foreach (BingGeocodePoint geocodePoint in locationInformation.GeocodePoints)
      if ((geocodePoint.UsageType & usageType) != BingUsageType.None)
          return geocodePoint.Location;
  return null;
}

See the following article to get more information about location data returned from Bing Maps Services: Location Data.

See Also