.NET Library for Google Maps API support
19,052
Solution 1
This API is still in development but may provide you with what you are looking for:
http://code.google.com/p/gmaps-api-net/
Solution 2
.NET wrapper libraries for the Google Maps API :
gmaps-api-net is outdated (at this time of answering) - the last update for the Directions API was made in 2016.
Usage example for GoogleApi:
using GoogleApi.Entities.Common;
using GoogleApi.Entities.Maps.Directions.Request;
using GoogleApi.Entities.Maps.Directions.Response;
public void GetRoute()
{
DirectionsRequest request = new DirectionsRequest();
request.Key = "AIzaSyAJgBs8LYok3rt15rZUg4aUxYIAYyFzNcw";
request.Origin = new Location("Brasov");
request.Destination = new Location("Merghindeal");
var response = GoogleApi.GoogleMaps.Directions.Query(request);
Console.WriteLine(response.Routes.First().Legs.First().DurationInTraffic);
Console.WriteLine(response.Routes.First().Legs.First().Distance);
Console.WriteLine(response.Routes.First().Legs.First().Steps);
}
Related videos on Youtube
Author by
elwyn
Updated on May 24, 2022Comments
-
elwyn almost 2 years
I'm looking for a .NET library or wrapper for Google Maps, that contains all the types of responses as C# classes.
I want to be able to do something like:
var url = "http://maps.googleapis.com/maps/api/geocode/json?address=Wellington&sensor=false"; //Utility functions would be ideal string jsonResponse = GoogleMaps.GetJson(url); string jsonResponse = GoogleMaps.GeocodeAddress("Wellington");
I would like to be able to use the results like:
GeocodeResponse r = JsonConvert.DeserializeObject<GeocodeResponse>(jsonResponse); //I am using Json.NET if(r.status.Equals("OK")) { DoSomethingWith(r.result.formatted_address); //intellisense documentation for all the bits in the result would be great }
Does such a thing exist?
This is sort of like these questions:
However the answers there are not what I am meaning, I'm not looking for a drag and drop map control.
-
Alex Pandrea almost 4 years
gmaps-api-net
(now on GitHub) is outdated