Showing posts with label Google Map. Show all posts
Showing posts with label Google Map. Show all posts

April 15, 2017

How to get Google Map API

To use the Google Maps Directions API, you must register your app project on the Google API Console and get a Google API key which you can add to your app or website.

Step 1: Get an API Key from the Google API Console

Click the button below, which guides you through the process of registering a project in the Google API Console, activates the Google Maps Directions API automatically, and generates a generic, unrestricted API key.

Step 2: Add the API key to your application

When loading the Google Maps Directions API, substitute YOUR_API_KEY in the code below with the API key you got from the previous step.

https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&key=YOUR_API_KEY

Detailed guide for users of the standard Google Maps Directions API

Follow these steps to get an API key:

Go to the Google API Console.
Create or select a project.
Click Continue to enable the API.
On the Credentials page, get an API key. 
Note: If you have an existing unrestricted API key, or a key with server restrictions, you may use that key.
From the dialog displaying the API key, select Restrict key to set a server restriction on the API key.
In the Key restriction section, select 'IP addresses (web servers, cron jobs, etc.), follow the on-screen instructions to add server IP addresses, then click Save. Read more about restricting API keys.
(Optional) Enable billing. See Usage Limits for more information.

Choosing an authentication method for your application

The section below provides a summary of the various tools and reports that are available to Premium Plan customers, based on the method you choose to authenticate your application.

Authentication using an API key

By using an API key to authenticate your applications, you can:
Manage all of your APIs in the Google API Console.
Access real-time usage data and 30 days of historical usage data for your application in the Google API Console.
View usage reports with more than 30 days of data in the Google Cloud Support Portal.
Authentication using a client ID and digital signature
By using your client ID and digital signature (instead of an API key) to authenticate your application, you can:
Add the channel parameter to requests so you can view more detailed usage reports.
View usage reports with more than 30 days of data in the Google Cloud Support Portal.
Use Maps Analytics tools for the Maps JavaScript API.

Authenticating your application using a client ID and digital signature

Upon purchasing your Google Maps APIs Premium Plan license, you will receive a welcome email from Google that contains your client ID and your private cryptographic key.
Read more about the cryptographic key which you can use to generate a unique digital signature.

You must use both the client ID and unique digital signature to authenticate the Directions API.

The code example below shows you the client and signature parameters to which you must pass your client ID and unique digital signature.

    https://maps.googleapis.com/maps/api/directions/json
      ?origin=Toronto
      &destination=Montreal
      &client=gme-YOUR_CLIENT_ID
      &signature=YOUR_URL_SIGNATURE
Substitute gme-YOUR_CLIENT_ID with the client ID you got in your welcome email. All client IDs begin with a gme- prefix.
Substitute YOUR_URL_SIGNATURE with your unique digital signature. Read about how you can generate a digital signature using your cryptographic key.

Generating a digital signature

Requests to the Directions API by Google Maps APIs Premium Plan customers require a digital signature that you can generate using the private cryptographic key provided to you in your welcome email.

Follow the steps below to generate a digital signature for your request.

Construct the request URL without the signature, making sure to include your client parameter. Note that any non-standard characters will need to be URL-encoded:

https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&client=clientID

Note: All Google services require UTF-8 character encoding (which implicitly includes ASCII). If your applications operate using other character sets, make sure they construct URLs using UTF-8 and properly URL-encode them.
Strip off the domain portion of the request, leaving only the path and the query:

/maps/api/directions/json?origin=Toronto&destination=Montreal&client=clientID
Retrieve your private key, which is encoded in a modified Base64 for URLs, and sign the URL above using the HMAC-SHA1 algorithm. You may need to decode this key into its original binary format. Note that in most cryptographic libraries, the resulting signature will be in binary format.

Note: Modified Base64 for URLs replaces the + and / characters of standard Base64 with - and _ respectively, so that these Base64 signatures no longer need to be URL-encoded.
Encode the resulting binary signature using the modified Base64 for URLs to convert this signature into something that can be passed within a URL.
Attach this signature to the URL within a signature parameter:

https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&client=clientID&signature=base64signature

Restricting an API key

Google Maps APIs are available via HTTP web services, for web browsers, and Android or iOS apps. APIs in any platform can use a generic (unrestricted) API key. You can optionally add a restriction (for example, IP addresses) to the API key. Once restricted, a key will only work on platforms that support that type of restriction.

To add server restrictions to an existing, generic API key, do the following:

1. Go to the Credentials page of the Google API Console.
2. Select the project that contains the API key you want to edit.
3. On the Credentials page, from the list of API keys, select the name of the API key to edit           the details of the key.
4. In the Key restriction section of the page, select IP addresses (web servers, cron jobs, etc.),       follow the on-screen instructions to add server IP addresses, then click Save.

Troubleshooting authentication issues

If your request is malformed or supplies an invalid signature, the Google Maps Directions API returns an HTTP 403 (Forbidden) error.

To troubleshoot individual URLs, you can use the URL Signing Debugger. It allows you to quickly validate a URL and signature generated by your application.

Alternatively, Google Maps APIs Premium Plan customers can troubleshoot individual URLs by logging in to the Google Cloud Support Portal and selecting Resources > Google Maps APIs Premium Plan online tools > URL Signing Debugger for Web Service and Image APIs.

December 19, 2011

'Its Snowing' on Google


Google homepage is all set to entertain its users with fun elements during this Christmas and now it is the turn for snowing in Google. The newly added feature, 'Let it snow' helps its users imagine that its snowing and adds more fun in Google search experiences. Bagging another Easter Egg in its search experience, it becomes the most talked Google experience today. After the amusing interactive doodles, Google has once again surprised its fans with the 'do a barrel roll' and now with its chilled 'Let it snow', Google brings the festive season to the virtual world.


'Its Snowing' on Google


If you want to see snowing in Google search, just type 'Let it snow' and all of a sudden, it will start snowing on your browser. You won't get cold, you won't be frozen like ice cubs but still you can play around while it snows. The glimpse of falling snow flakes on the browser will be an amusement which you never thought off. You can clean off the snowflakes with mouse. To turn back to the normal browser, just click on the 'Deforest'.


Google is inspired by the song ‘Let it snow’ for its new Easter Egg on its search engine. ‘Let it snow’ is the famous Christmas song by Sammy Cahn. It was famed as one of the best seller songs. Though the song was not mentioned Christmas in its lyrics, this romantic song is popular as Christmas song with its festive feel and positive notes.


There are already a number of 56 popular Easter Eggs in Google Search to try, tilt, askew, do a barrel roll, zz, rr, anagram, ascii art, recursion, hanukkah are just a few among them. Google is adapting so many ideas to get users mind. There may be a ton lot of fun 'Easter Eggs' hidden in Google queries.


November 30, 2011

Google Maps 6.0 - Features New Indoor Mapping In Stores, Malls, Airports And Lots Of UI Changes


Google Maps for android has received an major update pushing the latest version to 6.0, the major version upgrade introduces an all new "indoor mapping" and positioning feature which works inside stores, malls, and airports getting users their way around with ease.
Using this new feature users will now be able to see where everything is located inside a building, and even switch between floors. The indoor mapping feature is not available for all locations yet and initially covers only large retailers, airports and transit stations in the U.S. and Japan.

Maps For Android 5.0 Vs 6.0