Generate Google Maps API KEY for Web

1. Go to : https://console.developers.google.com/project

2. Login into your google account

3. You can create new project or user existing project

1

4. Select library menu,

Capture

Please enable this 9 API feature, by clicking and enable one by one :

Capture

  1. Google Maps Android API
  2. Google Maps JavaScript API
  3. Google Places API for Android
  4. Google Places API Web Service
  5. Google Maps Roads API
  6. Geocoding API
  7. Directions API
  8. Distance Matrix API
  9. Google Maps Geolocation API

 

 

 

If step 4 success you will see your enabled API list at dashboard page.

5. Last step is to generate API Key. Select Credentials > Create Credentials > Api Key > Select Browser Key

 

asdasdasdasd

 

Restricted API key is important for web, because in web API key located at js file and everyone can get that API key, so please click RESTRICTED KEY on this dialog

 

The select this radio button



more from : https://developers.google.com/maps/documentation/javascript/get-api-key

Registering authorized URLs

To prevent a third party from using your client ID on their own website, the use of your client ID is restricted to a list of URLs that you specifically authorize.The following considerations apply regarding URLs that are authorized:

The domain name or IP address does not have to be publicly accessible.
For example, http://myintranet and http://192.168.1.1 are valid entries.
All subdomains of a specified domain are also authorized.
For example, if http://example.com is authorized, then http://www.example.com is also authorized. The reverse is not true: if http://www.example.com is authorized, http://example.com is not necessarily authorized.
All subpaths of an authorized path are also authorized.
For example, if http://example.com is authorized, then http://example.com/foo is also authorized. In addition, because subdomains of a specified domain are also authorized, http://sub.example.com/bar is authorized.
Paths are case sensitive.
For example, http://www.example.com/ThisPath/ is not the same as http://www.example.com/thispath/.
You may restrict valid URLs to those using certain ports.
For example, if http://example.com:8080/foo is specified, that doesn’t authorize http://example.com.
HTTP and HTTPS protocols are considered different URLs.
For example, if https://example.com is authorized, http://example.com is not necessarily authorized. If you’d like to authorize both at once, you may add a domain without using a protocol: example.com/

All the rules above are applied to each authorization, so you should take care to plan your authorizations carefully. For example, because all subpaths of a specified path are authorized, and all subdomains, you may end up authorizing pages that you didn’t intend to. For example:

http://example.com/ also authorizes http://sub.example.com/path.



DONE, you got your API key for Google Maps, here your API key :

AIzaSyCRuzNeaxVoMKXXXXXXXXXXXXXXXXXX

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *