Generating Key for Google Maps Javascript API: Difference between revisions
No edit summary |
No edit summary |
||
Line 50: | Line 50: | ||
[[File:Image 1323.png|none|thumb|799x799px]] | [[File:Image 1323.png|none|thumb|799x799px]] | ||
The key is filled in in the section '''Settings/ Google settings''' under '''Map Key API''' tab. | The key is filled in in the section '''Settings/ Google settings''' under '''Map Key API''' tab. | ||
[[File:Image 354.png|alt=|none| | [[File:Image 354.png|alt=|none|thumb|799x799px]] | ||
Then you will see the following screen.[[File:Image 74.png|none|frame]] | Then you will see the following screen.[[File:Image 74.png|none|frame]] |
Latest revision as of 12:23, 7 March 2024
Note: This manual is for osCommerce v4.
Create a new account in Google (if there is none) or login to the existing one.
Nothing can be done until billing is switched on (trial gives $300 for a new account for a year).
Go to the console page for developers.
https://console.developers.google.com/?pli=1
By default there is nothing in management panel section for the new account or if API has not been used yet.
Click on ENABLE APIS AND SERVICES link.
Click on VIEW ALL link for the Maps section.
Click on Maps Javascript API. After you enable it come back to this page and also click on Geocoding API and Places API and enable them in the same way as Maps Javascript API described below.
If the project in console has not been created yet Google system will ask to create it. Click on Create project button.
Indicate the project name, read Terms of Service, agree with them and click on Create button.
After creating the project the Google system will direct you to where you can enable the chosen Maps Javascript API. Click on Enable button.
Click on AGREE & CONTINUE button to proceed.
Finish the verification process.
Fill in the data and click on Go to Credentials button.
Choose Google Maps JavaScript API from Which API are you using? drop down list.
Choose Web browser (Javascript) from Where will you be calling the API from? drop down list.
Then click on What credentials do I need? button.
Fill in the fields:
Name: google-map-key
Accept requests from these HTTP referrers (web sites): domain name of the website (it is an optional field, when you would like to use this service for this site only).
Note: indicate only domain.
Click on Create API key button.
You will see the generated API key. Click on Done button.
Do the same process for Geocoding API and Places API. As a result you should have the following services.
The key is filled in in the section Settings/ Google settings under Map Key API tab.
Then you will see the following screen.
In order to use the key on the website with a high volume of queries to Google Maps Javascript API, it is necessary to pass domain verification and confirm your rights for the domain, where the key will be used. Otherwise in browser console the error will appear and the map will not work.
In order to pass domain verification on Credentials tab click on Domain verification link.
Click on Add domain button.
Indicate dns-name of the website only (for example mysite.com)
Important: Your site must be registered on Search Console with an https:// URL or with the domain name provider verification method.
On the page https://www.google.com/webmasters/verification/verification you can pass one of the suitable procedures of verification of a website owner. After that you will see the list of allowed domains.