ImageryServiceClient.GetImageryMetadata Method

 

Retrieves metadata for imagery hosted by Bing Maps.

Public Function GetImageryMetadata(ByVal request As ImageryMetadataRequest) As ImageryMetadataResponse

request

An ImageryMetadataRequest object that contains the header and parameter information for the service operation.

The ImageryProviders property contains the imagery data providers for the map style specified in the VEImageryMetadataOptions.MapStyle Property. If imagery metadata is needed for two different map styles, two GetImageryMetadata requests need to be made.

Example

Private Sub RequestImageryMetadata()
Dim Results As String
Try
' Set a Bing Maps key before making a request
Dim key = "Bing Maps Key"

Dim metadataRequest As New ImageryService.ImageryMetadataRequest()

' Set credentials using a valid Bing Maps Key
metadataRequest.Credentials = _
New ImageryService.Credentials() With {.ApplicationId = key}

' Set the imagery metadata request options
Dim centerLocation As New ImageryService.Location() _
With {.Latitude = 47.65, .Longitude = -122.24}

metadataRequest.Options = New ImageryService.ImageryMetadataOptions() _
With {.Location = centerLocation, .ZoomLevel = 10}

metadataRequest.Style = ImageryService.MapStyle.AerialWithLabels_v1

' Make the imagery metadata request
Dim ImageryServiceInstance As New ImageryService.ImageryServiceClient("BasicHttpBinding_IImageryService")
Dim metadataResponse = ImageryServiceInstance.GetImageryMetadata(metadataRequest)

Results = "The image requested was created between " & _
metadataResponse.Results(0).Vintage.From & " and " & _
metadataResponse.Results(0).Vintage.To

Catch ex As Exception
Results = "An exception occurred: " & ex.Message
End Try
End Sub
Show: