Back to Devexpress

BingGeocodeDataProvider Class

windowsforms-devexpress-dot-xtramap-b60b92e6.md

latest6.1 KB
Original Source

BingGeocodeDataProvider Class

OBSOLETE

This class is obsolete. Microsoft deprecated Bing Maps on June 30th, 2025. For alternative providers, see https://www.devexpress.com/bing-maps-winforms

The class that is used to send requests to the Bing Maps Geocode service.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[Obsolete("This class is obsolete. Microsoft deprecated Bing Maps on June 30th, 2025. For alternative providers, see https://www.devexpress.com/bing-maps-winforms")]
[PreferableMember("BingGeocodeDataProvider", "", "")]
public class BingGeocodeDataProvider :
    BingMapDataProviderBase,
    IMouseClickRequestSender
vb
<Obsolete("This class is obsolete. Microsoft deprecated Bing Maps on June 30th, 2025. For alternative providers, see https://www.devexpress.com/bing-maps-winforms")>
<PreferableMember("BingGeocodeDataProvider", "", "")>
Public Class BingGeocodeDataProvider
    Inherits BingMapDataProviderBase
    Implements IMouseClickRequestSender

Remarks

The Bing Geocode Data provider is represented by the BingGeocodeDataProvider object that can be accessed via the InformationLayer.DataProvider property.

Important

On May 21, 2024, Microsoft announced that Bing Maps for Enterprise and its API will be discontinued. Azure Maps will be a single unified enterprise mapping platform available from Microsoft.

To obtain and display map data from Azure Maps, we implemented the following providers:

For information on how to migrate your app from Bing Maps to Azure Maps, see the following help topic: Migrate from Bing Maps to Azure Maps Providers.

If you already have a Bing Maps for Enterprise license, you can keep using the current API. You must transition to the new API by June 30, 2025 (for free/basic licenses) or June 30, 2028 (for enterprise licenses). New licenses will no longer be available after June 30, 2025. Bing Maps will not work with our map controls without a license after that date.

If you wish to specify the number of requested results displayed, use the InformationDataProviderBase.MaxVisibleResultCount property.

Example

This example demonstrates how to provide the capability for end-users to search an address associated with a specified location on a map and get detailed information about this place in the pushpin’s tooltip, utilizing the Bing Geocode web service. Do this as follows:.

csharp
using DevExpress.XtraMap;
using System.Windows.Forms;

namespace GeocodeProvider {
    public partial class Form1 : Form {
        const string bingKey = "YOUR BING KEY HERE";

        InformationLayer GeocodeLayer {
            get {
                return (InformationLayer)mapControl1.Layers["GeocodeLayer"];
            }
        }

        public Form1() {
            InitializeComponent();

            GeocodeLayer.DataProvider = new BingGeocodeDataProvider() {
                BingKey = bingKey,
                MaxVisibleResultCount = 1
            };
        }
    }

}
vb
Imports DevExpress.XtraMap
Imports System.Windows.Forms

Namespace GeocodeProvider
    Partial Public Class Form1
        Inherits Form

        Private Const bingKey As String = "YOUR BING KEY HERE"

        Private ReadOnly Property GeocodeLayer() As InformationLayer
            Get
                Return CType(mapControl1.Layers("GeocodeLayer"), InformationLayer)
            End Get
        End Property

        Public Sub New()
            InitializeComponent()

            GeocodeLayer.DataProvider = New BingGeocodeDataProvider() With {.BingKey = bingKey, .MaxVisibleResultCount = 1}
        End Sub
    End Class

End Namespace

Implements

ISupportWebRequest

IMouseClickRequestSender

Inheritance

Object InformationDataProviderBase WebInformationDataProvider BingMapDataProviderBase BingGeocodeDataProvider

See Also

BingGeocodeDataProvider Members

GIS Data

DevExpress.XtraMap Namespace