sethwebster / GoogleMaps.LocationServices

A simple library (including Nuget Package) for Google Maps geolocation and reverse geolocation
http://nuget.org/List/Packages/GoogleMaps.LocationServices
44 stars 42 forks source link

GetAddressFromLatLong Bad Request #24

Closed hansgunnar closed 4 years ago

hansgunnar commented 6 years ago

Hi, I am trying to use Location services to resolve lat long coordinates into an address but when I am trying to use that method I get a 400 Bad Request, any idea Why?

sethwebster commented 6 years ago

A code sample or other information would be helpful.

hansgunnar commented 6 years ago

Hi, I'm just using it like this:

var locationService = new GoogleLocationService();

var locationAddress = locationService.GetAddressFromLatLang(tripMessage.Latitude, tripMessage.Longitude);
location = locationAddress.Address;

The latitude and longitude values are of type double. Got a try catch around that. There shouldn't be any more to it, should it?

Thanks

sethwebster commented 6 years ago

You probably need to set an API KEY (see docs) as without it, you're probably getting refused. Without more info, I can't help you.