Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

dkackman/PortableBingGeocoder

Repository files navigation

PortableBingGeocoder

Portable Class Library (PCL) REST client for Bing Location REST geocoding services. Targets .NET 45, Window Phone 8, and Windows 8.1.

For some reason Microsoft doesn't have a .NET client for Bing geocoding services. This library is intended to ease geocoding tasks in Window Phone and Windows Store App projects.

  • Requires a Bing Maps API Key

  • Available as a Nuget Package

      [TestMethod]
      public async Task RoundtripCoordinateToPostalCode()
      {
          var service = new GeoCoder(APIKEY.Key, "Portable Bing GeoCoder unit tests");
          var coord = await service.GetCoordinate(new Address() { postalCode = "55116", countryRegion = "US" });
    
          Assert.IsTrue(coord.Item1.AboutEqual(44.9108238220215));
          Assert.IsTrue(coord.Item2.AboutEqual(-93.1702041625977));
          
          var address = await service.GetAddress(coord.Item1, coord.Item2);
    
          Assert.AreEqual(address.postalCode, "55116");
      }