Geo.Code.Map.Google.API.Net
1.1.5
dotnet add package Geo.Code.Map.Google.API.Net --version 1.1.5
NuGet\Install-Package Geo.Code.Map.Google.API.Net -Version 1.1.5
<PackageReference Include="Geo.Code.Map.Google.API.Net" Version="1.1.5" />
paket add Geo.Code.Map.Google.API.Net --version 1.1.5
#r "nuget: Geo.Code.Map.Google.API.Net, 1.1.5"
// Install Geo.Code.Map.Google.API.Net as a Cake Addin
#addin nuget:?package=Geo.Code.Map.Google.API.Net&version=1.1.5
// Install Geo.Code.Map.Google.API.Net as a Cake Tool
#tool nuget:?package=Geo.Code.Map.Google.API.Net&version=1.1.5
Easy to use, you just need to configure your api key
Configuration.ApiKey = "your api key here";
Configuration also has the Uri address of the api which you can modify if necessary in
Configuration.GeocodeApiUrl = "your api url here";
by default is used: https://maps.googleapis.com/maps/api/geocode/json?
Once the configuration is done we just have to execute the method
await GeocodeService.GetGeoCode (Latitude, Longitude);
the method returns a Response Object structured as follows
public class Response { public string Status { get; set; } public string ErrorMessage { get; set; } public GeoCodeResult Geocode { get; set; } }
in case the call to the api is satisfactory
ErrorMessage = ""
Geocode returns the following structure
public class GeoCodeResult { public Route Route {get; set; } public AdministrativeAreaLevel_1 AdministrativeAreaLevel_1 {get; set; } public AdministrativeAreaLevel_2 AdministrativeAreaLevel_2 {get; set; } public Country Country {get; set; } public Locality Locality {get; set; } public Neighborhood Neighborhood {get; set; } public PostalCode PostalCode {get; set; } public SublocalityLevel_1 SublocalityLevel_1 {get; set; } public PlusCode PlusCode {get; set; } public Premise Premise {get; set; } public PointOfInterest PointOfInterest {get; set; } public StreetAddress StreetAddress {get; set; } }
some of these properties may be null since the api does not always have enough information.
Status = "OK"
In the case of an error in the call to the GeocodeApi the Response Object
public class Response { public string Status {get; set; } public string ErrorMessage {get; set; } public GeoCodeResult Geocode {get; set; } }
Return the following information
ErrorMessage returns the error message
Geocode = null
Status type of error
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
we send the latitude, longitude and an easy-to-understand object of the response provided by the Geocode API returns