Address in, GPS coordinates returned; GPS coordinates in, address returned

Ronald Chandler 41 Reputation points
2026-08-27T16:16:52.89+00:00

I am looking for Visual Basic code or a Visual Studio control that can accept a world-wide mailing address as input, and return GPS coordinates.

I am looking for Visual Basic code or a Visual Studio control that can accept GPS coordinates as input, and return a world-wide mailing address.

I am developing applications using Visual Studio on a Windows 10 laptop.

Bing used to provide software for this application, but it was discontinued.

Developer technologies | Visual Basic for Applications
0 comments No comments

3 answers

Sort by: Most helpful
  1. Jay Pham (WICLOUD CORPORATION) 4,355 Reputation points Microsoft External Staff Moderator
    2026-08-28T00:23:40.45+00:00

    I am currently working the issue and will provide an update soon. Thank you for your patience.

    Was this answer helpful?

    4 people found this answer helpful.

  2. Jay Pham (WICLOUD CORPORATION) 4,355 Reputation points Microsoft External Staff Moderator
    2026-08-28T02:21:54.1133333+00:00

    Hi @Ronald Chandler ,

    You are correct that Bing Maps for Enterprise, which previously offered the Locations REST services for this exact scenario, has been retired. Microsoft's official replacement is Azure Maps, and there is a dedicated Bing Maps to Azure Maps migration guide that confirms this transition and maps each Bing Maps service to its Azure Maps equivalent.

    Azure Maps covers both directions you described. For converting a worldwide mailing address into GPS coordinates, the service provides the Get Geocoding API, documented with the full request format and response schema. The request looks like this:

    GET https://atlas.microsoft.com/geocode?api-version=2025-01-01&query={address}&subscription-key={your-key}
    

    For the opposite direction, converting GPS coordinates into the nearest mailing address, the service provides the Get Reverse Geocoding API. The request looks like this:

    GET https://atlas.microsoft.com/reverseGeocode?api-version=2025-01-01&coordinates={longitude},{latitude}&subscription-key={your-key}
    

    Regarding your question about a Visual Studio control, there is no drag-and-drop control for this; the supported pattern is to call these REST endpoints directly, which in VB.NET only takes a few lines with HttpClient.

    Before you can call the APIs, you will need an Azure Maps account, and the steps to create one in the Azure portal are described in this quickstart. Once the account exists, you authenticate with its subscription key, and the article Manage authentication in Azure Maps shows exactly where to find the key and how the authentication options work. The Gen2 pricing tier includes free monthly transactions, which is typically more than enough for a desktop application.

    Here is a minimal Visual Basic example that performs both operations:

    Imports System.Net.Http
    Imports System.Text.Json
    
    Module GeocodingDemo
        Private ReadOnly Client As New HttpClient()
        Private Const Key As String = "YOUR_AZURE_MAPS_KEY"
    
        Async Function GetCoordinatesAsync(address As String) As Task(Of (Lat As Double, Lon As Double))
            Dim url = $"https://atlas.microsoft.com/geocode?api-version=2025-01-01&query={Uri.EscapeDataString(address)}&subscription-key={Key}"
            Dim json = Await Client.GetStringAsync(url)
            Using doc = JsonDocument.Parse(json)
                Dim coords = doc.RootElement.GetProperty("features")(0).GetProperty("geometry").GetProperty("coordinates")
                Return (coords(1).GetDouble(), coords(0).GetDouble()) ' GeoJSON order is [lon, lat]
            End Using
        End Function
    
        Async Function GetAddressAsync(lat As Double, lon As Double) As Task(Of String)
            Dim url = $"https://atlas.microsoft.com/reverseGeocode?api-version=2025-01-01&coordinates={lon},{lat}&subscription-key={Key}"
            Dim json = Await Client.GetStringAsync(url)
            Using doc = JsonDocument.Parse(json)
                Return doc.RootElement.GetProperty("features")(0).GetProperty("properties") _
                    .GetProperty("address").GetProperty("formattedAddress").GetString()
            End Using
        End Function
    End Module
    

    One small note: this approach applies to VB.NET projects in Visual Studio. If you are working in VBA (for example inside Office), the same REST endpoints work, but the HTTP call would use MSXML2.XMLHTTP instead; let me know if that is your situation and I can share an adapted example.

    If you found my response helpful or informative, I would greatly appreciate it if you could provide feedback by interacting with the system or leaving a comment below.

    Thank you.

    Was this answer helpful?

    1 person found this answer helpful.

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.