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

Please add postcode function #20

Closed ghost closed 4 years ago

ghost commented 6 years ago

I really love your api it works perfect, but the only thing i really need is the postcode function. I was searching for GetLatLongFromPostcode(33333) but unfortounetly it doesn´t exist. Is it possible to add this function, because on many websites it is possible to search for latlong via post code. Greetings.

sethwebster commented 6 years ago

Thanks!

There is a postcode api, I believe. Do you want to submit a pull request and add it yourself?

sethwebster commented 4 years ago

Just checked this -- if you submit a request to GetLatLongFromAddress and pass in a "Zip", you will get the lat/long back.

ie.

var postCode = new AddressData {
    Zip = "10025"
};

var gls = new GoogleLocationService("<YOUR API KEY>");
var latlong = gls.GetLatLongFromAddress(a);
// latlong should contain your result