GoogleMapsApi 1.4.0
dotnet add package GoogleMapsApi --version 1.4.0
NuGet\Install-Package GoogleMapsApi -Version 1.4.0
<PackageReference Include="GoogleMapsApi" Version="1.4.0" />
<PackageVersion Include="GoogleMapsApi" Version="1.4.0" />
<PackageReference Include="GoogleMapsApi" />
paket add GoogleMapsApi --version 1.4.0
#r "nuget: GoogleMapsApi, 1.4.0"
#:package GoogleMapsApi@1.4.0
#addin nuget:?package=GoogleMapsApi&version=1.4.0
#tool nuget:?package=GoogleMapsApi&version=1.4.0
google-maps
Google Maps Web Services API wrapper for .NET
For Quickstart and more info read the wiki pages (https://github.com/maximn/google-maps/wiki)
The web page - http://maximn.github.com/google-maps
NuGet page - https://www.nuget.org/packages/GoogleMapsApi/
Check out my blog at http://maxondev.com
Installation
Install via NuGet Package Manager:
Install-Package GoogleMapsApi
Or via .NET CLI:
dotnet add package GoogleMapsApi
Quickstart
This library wraps Google maps API.
You can easily query Google maps for Geocoding, Directions, Elevation, Distance Matrix, and Places.
NEW! Now you can easily show the results on a Static Google Map!
This Library is well documented and easy to use.
API Key Configuration
You can configure your Google Maps API key in several ways:
// Option 1: Set API key per request
DirectionsRequest directionsRequest = new DirectionsRequest()
{
Origin = "NYC, 5th and 39",
Destination = "Philadelphia, Chestnut and Walnut",
ApiKey = "your-google-maps-api-key"
};
// Option 2: Set globally via app.config/appsettings.json (see wiki for details)
Code Examples
Basic Usage
using GoogleMapsApi;
using GoogleMapsApi.Entities.Common;
using GoogleMapsApi.Entities.Directions.Request;
using GoogleMapsApi.Entities.Directions.Response;
using GoogleMapsApi.Entities.Geocoding.Request;
using GoogleMapsApi.Entities.Geocoding.Response;
using GoogleMapsApi.StaticMaps;
using GoogleMapsApi.StaticMaps.Entities;
//Static class use (Directions) (Can be made from static/instance class)
DirectionsRequest directionsRequest = new DirectionsRequest()
{
Origin = "NYC, 5th and 39",
Destination = "Philadelphia, Chestnut and Walnut",
};
// Synchronous call
DirectionsResponse directions = GoogleMaps.Directions.Query(directionsRequest);
Console.WriteLine(directions);
// Async call (recommended)
DirectionsResponse directions = await GoogleMaps.Directions.QueryAsync(directionsRequest);
Console.WriteLine(directions);
//Instance class use (Geocode) (Can be made from static/instance class)
GeocodingRequest geocodeRequest = new GeocodingRequest()
{
Address = "new york city",
};
var geocodingEngine = GoogleMaps.Geocode;
GeocodingResponse geocode = await geocodingEngine.QueryAsync(geocodeRequest);
Console.WriteLine(geocode);
// Static maps API - get static map of with the path of the directions request
StaticMapsEngine staticMapGenerator = new StaticMapsEngine();
//Path from previos directions request
IEnumerable<Step> steps = directions.Routes.First().Legs.First().Steps;
// All start locations
IList<ILocationString> path = steps.Select(step => step.StartLocation).ToList<ILocationString>();
// also the end location of the last step
path.Add(steps.Last().EndLocation);
string url = staticMapGenerator.GenerateStaticMapURL(new StaticMapRequest(new Location(40.38742, -74.55366), 9, new ImageSize(800, 400))
{
Pathes = new List<GoogleMapsApi.StaticMaps.Entities.Path>(){ new GoogleMapsApi.StaticMaps.Entities.Path()
{
Style = new PathStyle()
{
Color = "red"
},
Locations = path
}}
});
Console.WriteLine("Map with path: " + url);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
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. |
-
.NETFramework 4.6.2
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 8.0.5)
-
.NETFramework 4.8.1
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 8.0.5)
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.5)
-
net6.0
- System.Text.Json (>= 8.0.5)
-
net8.0
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.4.0 | 60 | 9/5/2025 |
1.3.9 | 236 | 9/3/2025 |
1.3.8 | 109 | 9/3/2025 |
1.3.7 | 112 | 9/3/2025 |
1.3.6 | 109 | 9/3/2025 |
1.3.5 | 110 | 9/3/2025 |
1.3.4 | 116 | 9/3/2025 |
1.3.3 | 62,463 | 11/4/2024 |
1.3.2 | 10,007 | 10/15/2024 |
1.3.1 | 136 | 10/15/2024 |
1.3.0 | 3,314 | 10/9/2024 |
1.2.8 | 154 | 10/9/2024 |
1.2.7 | 143 | 10/9/2024 |
1.2.6 | 153 | 10/9/2024 |
1.2.5 | 174 | 10/8/2024 |
1.2.3 | 125 | 10/8/2024 |
1.2.2 | 147 | 10/8/2024 |
1.2.1 | 293,546 | 9/6/2022 |
1.2.0 | 51,160 | 12/22/2021 |
1.0.1 | 6,085 | 12/12/2021 |
1.0.0 | 655 | 12/12/2021 |
0.80.0 | 191,946 | 12/8/2019 |
0.78.0 | 72,175 | 12/11/2018 |
0.77.0 | 16,017 | 11/10/2018 |
0.76.0 | 7,898 | 10/2/2018 |
0.75.0 | 4,994 | 8/30/2018 |
0.74.0 | 1,304 | 8/29/2018 |
0.73.0 | 5,474 | 8/19/2018 |
0.72.0 | 22,173 | 5/9/2018 |
0.70.0 | 5,057 | 3/29/2018 |
0.69.0 | 29,118 | 12/26/2017 |
0.68.0 | 4,123 | 11/27/2017 |
0.67.0 | 7,055 | 10/21/2017 |
0.66.0 | 120,114 | 6/13/2017 |
0.65.0 | 33,113 | 4/14/2017 |
0.64.0 | 6,095 | 3/26/2017 |
0.63.0 | 6,395 | 2/28/2017 |
0.62.0 | 2,367 | 2/22/2017 |
0.61.0 | 6,442 | 1/19/2017 |
0.60.0 | 86,228 | 11/8/2016 |
0.59.0 | 13,451 | 9/11/2016 |
0.58.0 | 2,631 | 9/5/2016 |
0.57.0 | 6,916 | 8/24/2016 |
0.56.0 | 25,774 | 7/14/2016 |
0.55.0 | 2,678 | 6/26/2016 |
0.54.0 | 5,499 | 5/19/2016 |
0.53.0 | 2,695 | 5/4/2016 |
0.52.0 | 6,030 | 4/4/2016 |
0.50.0 | 2,788 | 3/27/2016 |
0.49.0 | 41,344 | 3/7/2016 |
0.46.0 | 1,685 | 3/5/2016 |
0.45.0 | 2,194 | 2/25/2016 |
0.44.0 | 7,651 | 2/17/2016 |
0.43.0 | 10,057 | 2/11/2016 |
0.42.0 | 25,911 | 10/17/2015 |
0.41.0 | 266,248 | 1/31/2015 |
0.40.0 | 18,939 | 5/23/2014 |
0.32.0 | 2,836 | 5/19/2014 |
0.31.0 | 3,522 | 4/16/2014 |
0.30.0 | 72,210 | 12/22/2013 |
0.22.0 | 19,932 | 5/31/2013 |
0.20.0 | 9,218 | 3/30/2013 |
0.19.0 | 11,525 | 11/23/2012 |
0.18.0 | 2,287 | 10/22/2012 |
0.17.0 | 53,678 | 7/27/2012 |
0.16.0 | 1,993 | 7/21/2012 |
0.15.0 | 2,133 | 7/5/2012 |
0.14.0.1 | 1,989 | 6/12/2012 |
0.14.0 | 1,937 | 6/12/2012 |
0.13.0 | 2,060 | 5/9/2012 |
0.12.0.2 | 1,910 | 5/6/2012 |
0.12.0.1 | 1,870 | 5/6/2012 |
0.11.0 | 1,985 | 5/6/2012 |
0.10.0 | 2,199 | 5/6/2012 |