A lightweight method for communicating with the Google geocoding APIs. This includes models and interfaces for calling Google.
$ dotnet add package Geo.GoogleThis allows the simple calling of Google geocoding APIs. The supported Google geocoding endpoints are:
In the startup ConfigureServices method, add the configuration for the Google service:
using Geo.Extensions.DependencyInjection;
.
.
.
public void ConfigureServices(IServiceCollection services)
{
.
.
.
var builder = services.AddGoogleGeocoding();
builder.AddKey(your_google_api_key_here);
builder.HttpClientBuilder.ConfigureHttpClient(configure_client);
.
.
.
}
By calling AddGoogleGeocoding, the IGoogleGeocoding interface has been added to the IOC container. Just request it as a DI item:
public MyService(IGoogleGeocoding googleGeocoding)
{
...
}
Now simply call the geocoding methods in the interface.