Back to Devexpress

AzureAddress Class

windowsforms-devexpress-dot-xtramap-168db0b6.md

latest2.9 KB
Original Source

AzureAddress Class

Contains the address information obtained from the Azure Maps GIS service.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[IgnoreAttributesTest]
public class AzureAddress :
    AddressBase
vb
<IgnoreAttributesTest>
Public Class AzureAddress
    Inherits AddressBase

Remarks

The following code snippet searches for the locations that correspond to the specified AzureAddress:

csharp
using DevExpress.XtraMap;
// ...
const string azureKey = "your key";
//...
AzureSearchDataProvider azureSearchProvider = new AzureSearchDataProvider() {
  AzureKey = azureKey,
};
// Specify the address info.
azureSearchProvider.Search(new AzureAddress() {
    AddressLine = "15127 NE 24th St",
    CountryRegion = "United States",
    AdminDistricts = new string[,] { { "WA" } , {"King County"} }, 
    Locality = "Redmond",
    PostalCode = "98052"
}, 5);
// Create a layer.
InformationLayer informationLayer = new InformationLayer();
informationLayer.DataProvider = azureSearchProvider;
// Zoom the map to fit the rearch result.
informationLayer.DataRequestCompleted += OnDataRequestCompleted;
void OnDataRequestCompleted(object sender, RequestCompletedEventArgs e) {
    map.ZoomToFitLayerItems(0.4);
}
// Add the created layers to the collection.
map.Layers.Add(informationLayer);
vb
Imports DevExpress.XtraMap
' ...
Private Const azureKey As String = "your key"
'...
Private azureSearchProvider As New AzureSearchDataProvider() With {.AzureKey = azureKey}
' Specify the address info.
azureSearchProvider.Search(New AzureAddress() With {
    .AddressLine = "15127 NE 24th St",
    .CountryRegion = "United States",
    .AdminDistricts = New String(, ) {
        { "WA" },
        {"King County"}
    },
    .Locality = "Redmond",
    .PostalCode = "98052"
}, 5)
' Create a layer.
Dim informationLayer As New InformationLayer()
informationLayer.DataProvider = azureSearchProvider
' Zoom the map to fit the rearch result.
Private informationLayer.DataRequestCompleted += AddressOf OnDataRequestCompleted
Private Sub OnDataRequestCompleted(ByVal sender As Object, ByVal e As RequestCompletedEventArgs)
    map.ZoomToFitLayerItems(0.4)
End Sub
' Add the created layers to the collection.
map.Layers.Add(informationLayer)

Inheritance

Object AddressBase AzureAddress

See Also

AzureAddress Members

DevExpress.XtraMap Namespace