I am doing a custom google map with API
I put the URL link :
https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318&markers=color:red|label:C|40.718217,-73.998284&key=AIzaSyCTFUKmdIRSSod5v1oqhIXJOmkOPMsdFp0
I received this error:
The Google Maps Platform server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/static_maps_backend?project=_
I enabled API AND THE error still exist
Can you please help me find the solituion for my problem
In order to use the Google maps api your going to have to first off enable the maps api in the Google developer console for that project. Then you will need to enable billing for the project as there is no longer a free tear for maps api.
Once you have done that you can create an api key and use it in your code.
The Google Maps Platform server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/static_maps_backend?project=_
This message means that you have not enabled the maps api for your project. It can take a few minutes before it kicks in if you just enabled it. Make sure you have done it for the cogrect project as well by clicking on the link that it showed you.
You are going to need maps javascript API for a real map and embed it in a div
Here is a basic example on how to achieve that.
In the script tag in the html section you need to replace YOUR_API_KEY for the real one from google.
jsbin example
https://jsbin.com/xiragigegi/edit?html,css,js,output
Related
I've started getting this error from a Google Maps widget within a CMS I use:
This API key is not authorized to use this service or API. Places API error: ApiTargetBlockedMapError
The error message provides a helpful link to this page, which includes the following text:
ApiTargetBlockedMapError Error
The Maps JavaScript API has not been authorized for the used API key.
Please check the API restrictions settings of your API key in the
Google Cloud Platform Console.
See API keys in the Google Cloud Platform Console. For more
information, see Using API Keys.
I know Google has tweaked this API in the past, so I went to the console and checked the permissions given for the key I am using. It includes these four permissions, include the Maps JavaScript API permission:
Geocoding API
Maps Embed API
Maps JavaScript API
Maps Static API
The only part not working is the address auto-complete. When I change to Don't Restrict Key mode so the key works with all services, it works fine. Any idea which service checkbox I might be missing? I'm wondering if Google is just displaying the wrong error.
Any ideas?
This is what I did. Updated.
Make sure you have enabled all the next Google Maps Services
If you have key restrictions, make sure you add the services like the next image..
Restart the project. It worked.
It turns out that Google has tweaked their permissions settings without updating the error. I had to give access to the Places API as well for the autocomplete to function.
I've submitted a PR to the CMS widget's documentation:
https://github.com/Frojd/wagtail-geo-widget/pull/59/files
I maintain a WordPress store locator plugin, and this week someone told me it wasn't working anymore. Eventually he fixed it by verifying his domain in the API Console.
That this was a solution to some APIs of Google Maps not working was new to me, and it's also the first time someone told me they fixed it this way.
The problem is that I can't find any information in which scenario verifying your domain fixes a Google Maps API related problem. I read through the Geocode API / Google Maps JavaScript API / Google Places API Web Service pages, but no where do I see something about the need to verify your domain ( I could of course have missed it ).
Does anyone know when you need to verify your domain if you want to use the Google Maps APIs? Normally it works fine without doing it, but in his case it wasn't, and I really like to know what he could possible have done to make it a requirement.
You shouldn't need to verify the domain for using Google Maps API.
You need to generate one API Key for your app so you can use it when you call the Google Map JavaScript API like this:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
Substitute the value YOUR_API_KEY for the one that Google generated for you.
I am using the Google Places Autocomplete API in two spots in my app, but it's sharing the same script and API_KEY. In one location, the places autocomplete works fine, but in the other it fails silently except for the return value found in the "AutocompletionService.GetPredictions" request in the network tab:
/**/_xdc_._6bvokq && _xdc_._6bvokq( [3, null, null,…] )
0: 3
1: null
2: null
3: "This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/places_backend?project=_ For more information on authentication and Google Maps Javascript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
I have "enabled" the places web api as well as the maps javascript api in my google developer api console.
I have experienced this problem as well and solved it by enabling the Geolocation and Geocoding web services. Depending on location these are queried as well. After enabling these services in the api the problem was solved for me. Hope the same works for you.
I'm looking at getting some stats out of Google Analytics using the Embed API to display on our site using javascript.
My question is:
Is it possible to display the stats without the user authenticating? I.e. I would like to make some traffic statistics available to anonymous users.
Thanks,
Chris.
This is definitely possible, but you'll have to get the access token yourself (server side, using whatever OAuth 2.0 flow you want).
Once you have a valid access token, you can pass it to the gapi.analytics.auth component and use the Embed API as normal.
Here's some documentation on that:
https://developers.google.com/analytics/devguides/reporting/embed/v1/component-reference#auth
UPDATE: (07/27/2015)
A demo of server-side authorization with the Embed API is now featured on the Google Analytics Demos & Tools site. You should look there to see a working example.
I am working on an ASP.NET website that uses google maps API. as sited in the tutorial in google.com I need a google API key to make it work. I got that key, but every time that I run my website, I get the following error:
Google has disabled use of the Maps API for this application. The
provided key is not a valid Google API Key, or it is not authorized
for the Google Maps Javascript API v2 on this site. If you are the
owner of this application, you can learn about obtaining a valid key
here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key
What could the problem be? The tutorial says nothing about what to do with the API key. It just says go to services and activate google Maps API v2 to get a key.
Thanks!
Did you include the API key into the URL when you load the Google Maps script?
From the link to the docs in the error message:
<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg&sensor=true_or_false"
type="text/javascript"></script>
The link used to load the script is:
http://maps.google.com/maps?file=api&v=2&key=abcdefg&sensor=true_or_false
You need to replace that abcdef with the API key you got from Google Maps.