Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GeocodeRequestResult Class

Contains results of a request to a web service to obtain Geocode information about a specific location on a map.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public class GeocodeRequestResult :
    RequestResultBase

The following members return GeocodeRequestResult objects:

#Remarks

An object of this class is accessed using the LocationInformationReceivedEventArgs.Result property.

#Example

To manually generate map items for received GIS data, do the following.

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
                });
        }
    }
}

#Inheritance

Object
RequestResultBase
GeocodeRequestResult
See Also