Working with the Google Location API

前端 未结 6 2106
别跟我提以往
别跟我提以往 2021-02-06 05:50

Forgive me for my ignorance, but after several hours of searching, I\'m having little luck.

Anyway, I am attempting to write a small desktop application that will allow

6条回答
  •  滥情空心
    2021-02-06 06:21

    Fully documented .NET library -

    Google Maps Web Services API wrapper for .NET https://github.com/maximn/google-maps/

    //Directions
    DirectionsRequest directionsRequest = new DirectionsRequest()
    {
            Origin = "NYC, 5th and 39",
            Destination = "Philladephia, Chesnut and Wallnut",
    };
    
            DirectionsResponse directions = MapsAPI.GetDirections(directionsRequest);
    
    //Geocode
    GeocodingRequest geocodeRequest = new GeocodingRequest()
    {
            Address = "new york city",
    };
    
    
    GeocodingResponse geocode = MapsAPI.GetGeocode(geocodeRequest);
    
    Console.WriteLine(geocode);
    
    //Elevation
    ElevationRequest elevationRequest = new ElevationRequest()
    {
            Locations = new Location[] { new Location(54, 78) },
    };
    
    
    ElevationResponse elevation = MapsAPI.GetElevation(elevationRequest);
    
    Console.WriteLine(elevation);
    

提交回复
热议问题