API key for Google maps on the project http://kislorod123.ru does not work - google-maps

API key for Google maps on the project http://kislorod123.ru does not work
At the same time we added the domain name in 3 versions: http://joxi.ru/BA0N8P7UMqal8m
At the moment, we have removed the restrictions for the maps to work on the sites, because we are a web studio and customers are complaining, but the map does not work either.
Tell me how to solve the problem with the operation of the API in the mode of limited access and without restrictions

You may try using the recommended format of http referrers. Remove all the restrictions for kislorod123.ru then add the following restrictions below:
kislorod123.ru
*.kislorod123.ru
These two will allow your API key to be used in all subdomains and paths in your website.
Also note to remove any duplicate restrictions as this will affect the restriction and may cause error. Also the http:// is not necessary.

Related

How can I check whether Google keys are embeded/enabled in Chromium/Chrome or not?

I build Chromium with Google keys (Google API, Oauth Client ID, Oauth Client Secret).
I could embed above Google keys well in Chromium source before building.
But I wanna check the keys in Chromium binary after building.
If I type chrome://version in Chromium, can check flags which r adopted in Chromium browser. But I don't know how to check the keys.
Or I just wanna check whether the keys are enabled or not.
Is there a way to check whether Google API is embeded/enabled in Chromium/Chrome or not?
Chromium will first try to read the value of these env. variables from the system before using embedded API keys, if they are present:
GOOGLE_API_KEY
GOOGLE_DEFAULT_CLIENT_ID
GOOGLE_DEFAULT_CLIENT_SECRET
if they are not present then it will use embedded values instead.
There are a couple of ways to find out if a Chromium fork was compiled with Google API keys:
If the API keys are absent, Chromium will show a bubble control on startup stating that API keys are missing. But as mentioned above, you can't find out if the API keys are embedded or read from env. variables using this method.
Use Chrome sync feature to check if Google API keys are present or not. Just try to sync Google accounts with Chromium. If they keys are not present then it won't work. FYI, this feature won't be available to Chromium browsers past March 15 because of policy changes led by Google.
Again, you can't use this method to find out if the API keys are embedded or not.
Use this method to find out if the API keys are embedded you can find out by enabling logging when starting Chromium. You should go through the log file to find out if the API keys are being read from env. variable or are embedded. More info on how to enable logging: Here

Google Maps Javascript: load file:/// URLs

Based on Google's recent announcement I need a way to load the Google Maps Javscript API from my mobile hybrid/Cordova app. I could whitelist file:/// URLs from my console, but I'd rather not because that means anyone who could learn my client ID could then use it in their own app and I'd have no way to protect myself from that.
Apparently Google now supports some kind of API key, but only for Premium accounts created since January of this year, which mine is not.
Is there some other way to allow my mobile app to access the Google Maps Javascript API without opening up such a risk?
If you are a Standard Plan user: you need to load the Maps Javascript API with a key. Per the current limitation on API keys and file:// URLs, you will have to open up the key. You can star this bug to be alerted of updates.
If you are a Premium Plan user, you also have the option to use a client ID, which can be more tightly secured. You can file a support case to request that your client ID authorizes only the file:// URL(s) that you are using.
UPDATE
Restrictions for file protocol were introduced in Google Maps JavaScript API. You can find information in the official documentation:
https://developers.google.com/maps/documentation/javascript/get-api-key#key-restrictions
file:// referers need a special representation to be added to the Key restriction. The "file:/" part should be replaced with "__file_url__" before being added to the Key restriction. For example, "file:///path/to/" should be formatted as "__file_url__//path/to/*". After enabling file:// referers, it is recommended you regularly check your usage, to make sure it matches your expectations.

Google Maps API warning: NoApiKeys

I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:
Google Maps API warning: NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
I include the script the standard way:
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
And google.maps.version indicates that I'm using 3.24.2.
In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.
Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.
Should I worry about it?
Creating and using the key is the way to go.
The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.
BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances.
This however doesn't shush the console warning.
You have to add the key as a parameter when including the api.
<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script>
Get the key here: GoogleApiKey Generation site
A key currently still is not required ("required" in the meaning "it will not work without"), but I think there is a good reason for the warning.
But in the documentation you may read now : "All JavaScript API applications require authentication."
I'm sure that it's planned for the future , that Javascript API Applications will not work without a key(as it has been in V2).
You better use a key when you want to be sure that your application will still work in 1 or 2 years.
I had the same problem and I found out that if you add the URL param ?v=3 you won't get the warning message anymore:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>
Reproduction online
As pointed out in the comments by #Zia Ul Rehman Mughal
Turns out specifying this means you are referring to old frozen version 3.0 not the latest version. Frozen old versions are not updated with bug fixes or anything. But this is good to mention though.
https://developers.google.com/maps/documentation/javascript/versions#the-frozen-version
Update 07-Jun-2016
This solution doesn't work anymore.
Google maps requires an API key for new projects since june 2016. For more information take a look at the Google Developers Blog. Also more information in german you'll find at this blog post from the clickstorm Blog.

Google disabled use of the Maps API for V3

I am an amateur website developer but proficient in html and javascript.
I have a handful of websites using the Google Maps API V2 with no problem. I tried to upgrade to V3. I got a new API key and used the sample html (based on Australia) provided by Google. All I got was the 'disabled' message.
If I remove the key completely it works! What am I doing wrong?!! (www.gn45.com/gmap.html)
This message appears, because there's a particular domain whitelist, that is configured for each business account. By default, you can always access google APIs with an API key from localhost, but any other domain should be specifically set within account management.
With the mobile application, your index.html is read from the filesystem and then passed to in App Browser. Therefore google rejects a request to the API with API key. You can temporarily remove API key from your request and access the API without any, this way you'll have a 50k request/month limit, which should be sufficient for development purposes.
I'm looking for a way to configure this myself, as soon as I find one, I'll provide an update.

What site do you specify when applying for key to google maps?

I may be dim, but I really don't know what to answer when google asks me for a URL when asking for a key for google maps.
I mean, I'm on my laptop, with no internet dns entry developing the solution in visual studio, so what do i tell google? localhost? The domain name I know the site will end up on? my laptops name?
Use the key which will correspond to the name of the server in the URL. I've used both localhost and the name of the laptop on local network.
Change to a different key on the production server.
I have always set up the API key to represent the sites future URL. I have seen no issues with using the API key on localhost that was setup for domainname.com, but that may be related to the subset of the Google Map APIs that I utilize. I would use your site's final URL when you set up the key for Google Maps.