简体   繁体   中英

How to use google API Key into a CDN link get json format for fetch user's current Address?

I want to set User's current location for my website, I use java script geographical location, I got user's longitude and latitude, then I tried to change that into a address format, so I'm using google maps content delivery network link with my google maps applet programming interface key, and then I pass my Content delivery network link with that longitude and latitude on my browser, but it show some JavaScript Object Notation format error message like following code,

{
   "error_message" : "This API project is not authorized to use this API.",
   "results" : [],
   "status" : "REQUEST_DENIED"
}

What should I do for solve this issue ?

I have tried on a e-learn website html geographical location and then I added some java script codes.

I need to show a user current location like an address on my navigation bar, when user click the location icon.

It's not a CDN (Content Delivery Network), which serves files, but an API (Application Programming Interface).

You need to log in to your Google developers console .

Then in the navigation menu on the left, go to APIs & services > Credentials .

Here you have your API keys, you can enable/disable restrictions to applications, domains and IP addresses that can use this key.

Unless you explicitely authorise your application to use this key, access will be denied.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM