LocationInformation Class
Contains information about a specific location on a map.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v18.1.dll
Declaration
Related API Members
The following members accept/return LocationInformation objects:
Example
To manually generate map items for received GIS data, do the following.
- Set the InformationDataProviderBase.GenerateLayerItems property to false.
- Handle the Geocode data received event of the Bing geocode data provider (BingGeocodeDataProvider.LocationInformationReceived).
- In the event handler, implement map item generation based on information stored in the GeocodeRequestResult.Locations array of LocationInformation objects.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-manually-generate-map-items-for-received-gis-data-t188443
using DevExpress.XtraMap;
using System.Windows.Forms;
namespace WinForms_MapControl_InformationLayer {
public partial class Form1 : Form {
InformationLayer GeocodeLayer { get { return (InformationLayer)mapControl1.Layers["GeocodeLayer"]; } }
BingGeocodeDataProvider GeocodeProvider { get { return (BingGeocodeDataProvider)GeocodeLayer.DataProvider; } }
public Form1() {
InitializeComponent();
GeocodeProvider.LocationInformationReceived += GeocodeProvider_LocationInformationReceived;
}
void GeocodeProvider_LocationInformationReceived(object sender, LocationInformationReceivedEventArgs e) {
if ((e.Cancelled) && (e.Result.ResultCode != RequestResultCode.Success)) return;
GeocodeLayer.Data.Items.Clear();
foreach (LocationInformation locationInformation in e.Result.Locations)
GeocodeLayer.Data.Items.Add(new MapCallout() {
Location = locationInformation.Location,
Text = locationInformation.DisplayName
});
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the LocationInformation class.
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.