Coder Social home page Coder Social logo

djgarciac / googlemapsapi.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linguanostra/googlemapsapi.net

0.0 0.0 0.0 212 KB

.NET client library for Google Maps API Web Services

License: BSD 3-Clause "New" or "Revised" License

C# 99.97% Batchfile 0.03%

googlemapsapi.net's Introduction

.NET client library for Google Maps API Web Services

Description

This library brings the Google Maps API Web Services to your .NET application.

The .NET client library for Google Maps API Web Services is a .NET Client library for the following Google Maps APIs:

Keep in mind that the same terms and conditions apply to usage of the APIs when they're accessed through this library.

Support

This library was ported from the community supported Python client library for Google Maps API Web Services.

All the features of the Python library, in addition to the tests have been ported to this library as well.

Since it's a new release, proper testing should be done to ensure it's stable enough to use in real production applications.

If you find a bug, or have a feature suggestion, please log an issue. If you'd like to contribute, please read How to Contribute.

This library is not endorsed by Google.

Requirements

  • .NET Framework 4.0 or later
  • A Google Maps API key.

API keys

Each Google Maps Web Service requires an API key or Client ID. API keys are freely available with a Google Account at https://developers.google.com/console. To generate a server key for your project:

  1. Visit https://developers.google.com/console and log in with a Google Account.
  2. Select an existing project, or create a new project.
  3. Click Enable an API.
  4. Browse for the API, and set its status to "On". The Python Client for Google Maps Services accesses the following APIs:
    • Directions API
    • Distance Matrix API
    • Elevation API
    • Geocoding API
    • Time Zone API
    • Roads API
    • Street View Image API
  5. Once you've enabled the APIs, click Credentials from the left navigation of the Developer Console.
  6. In the "Public API access", click Create new Key.
  7. Choose Server Key.
  8. If you'd like to restrict requests to a specific IP address, do so now.
  9. Click Create.

Your API key should be 40 characters long, and begin with AIza.

Important: This key should be kept secret on your server.

Installation

Using Nuget

Install-Package GoogleMapsAPI.NET

Cloning sources

git clone https://github.com/linguanostra/GoogleMapsAPI.NET.git

Developer Documentation

View the reference documentation

Additional documentation for the included web services is available at https://developers.google.com/maps/.

Usage

This example uses the Geocoding API and the Directions API.

// Get client
var client = new MapsAPIClient("Add Your Key here");

// Geocoding an address
var geocodeResult = client.Geocoding.Geocode("1600 Amphitheatre Parkway, Mountain View, CA");

// Look up an address with reverse geocoding
var reverseGeocodeResult = client.Geocoding.ReverseGeocode(40.714224, -73.961452);

// Request directions via public transit
var directionsResult = client.Directions.GetDirections("Sydney Town Hall",
    "Parramatta, NSW",
    mode: TransportationModeEnum.Transit,
    departureTime: DateTime.Now);

For more usage examples, check out the tests.

Features

Retry on Failure

Automatically retry when intermittent failures occur. That is, when any of the retriable 5xx errors are returned from the API.

Keys and Client IDs

Maps API for Work customers can use their client ID and secret to authenticate. Free customers can use their API key, too.

Building the Project

The solution GoogleMapsAPI.NET.sln was made with Visual Studio 2015. It's Nuget-enabled, the required packages should restore automatically when building.

googlemapsapi.net's People

Contributors

linguanostra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.