I have been having trouble with the Google Maps API for one week now and I'm unable to resolve it :(
I have a site that has been using the Google Maps v3 for several weeks now without any issues. But suddenly, it starts complaining that: Google has deactivated the use of the Google Maps API for this application, because the offered key is not a valid Google-API-Key or the use of Google Maps v3 is not allowed for this site.
I double checked everything, including: trying a new key; checking domain restrictions and activation in the API-console - Everything is alright.
I'm using simple authentication. Every help would be highly appreciated :)
The Version Handling Has Changed. This Code Is No Longer Valid (see the code below in the update):
One thing you can do immediately to bypass such problems: explicitly set the version of the API you are using to 3.6:
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?v=3.6&sensor=false">
</script>
Keys were introduced in 3.7, so you do not get any warnings if you set your version to: 3.6.
Important Update That Makes the JavaScript Code Above Invalid:
Setting the version to 3.6 will no longer function as a work-around for this, because you are no longer able to request version 3.6. You should not use the code above, but should use the following code to load the Google Maps JavaScript 3.8 library:
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?v=3.8&sensor=false">
</script>
Google recently announced a version update; here is the content of the Google announcement email:
We recently released a new minor version of the Google Maps API. This
means that the versions are now:
3.9: Development/Nightly
3.8: Feature Stable
3.7: Frozen
3.6 has been removed: if you request it you will receive 3.7.
In this latest release of 3.9, we've added:
* Country restriction for Autocomplete (AutocompleteOptions?.componentRestrictions)
* Regions and Cities type filters
You will also get all the features of 3.8 (now Feature Stable),
including:
WeatherLayer and CloudLayer
Click-to-go/Click-to-zoom in Street View
orderBy, limit and offset for FusionTablesLayer
utc_offset and opening_hours in PlaceResult
google.maps.geometry.poly.containsLocation() and isLocationOnEdge()
DemographicsLayer (Maps for Business only)
Related
I am trying to create a front end website to talk to a Firestore Database and have been following the official documentation for the new version 9 modules but I have given up with this route as I just keep getting errors so I have started looking at another tutorial which I have got working but I have a question regarding the html head script tags.
In the html I have the following.
<!-- Firebase App is always required and must be first -->
<script src="https://www.gstatic.com/firebasejs/5.0.3/firebase-app.js"></script>
<!-- Add additional services you want to use -->
<script src="https://www.gstatic.com/firebasejs/5.0.3/firebase-firestore.js"></script>>
My question is:
Am I ok to use version 5.03 or is it likely this will get removed from the gstatic.com in due course now they are moving over to version 9 modules.
firebaser here
Firebase doesn't remove SDKs from its CDNs. You can still find our 0.9 and event 0.0 SDK versions there, and in fact (I happened to recently check some usage statistic) they are still being used (luckily very sparingly 😀).
That said, I recommend upgrading to a more recent version to ensure you get the latest improvements and fixes. I get that the new modular syntax in v9 may be a big step, so a first step towards that could be to use the compat versions, which are drop-in compatible with v8 (and often earlier versions).
What is the signification of "https://maps.googleapis.com/maps/api/js?v=3" in term of the used Google Map API version?
In the Google Map documentation, it defines v=n.mm with by examples v=3.34 or v=3.35.
But nothing explains when you use v=3.
What does it mean please?
That used to be how google suggested requesting the "release" version of the API (before the weekly/quarterly versions were added).
from an old version of the documentation on archive.org:
For regular applications
We recommend specifying v=3 in your bootstrap request. This means that you always get the current release version of the Google Maps JavaScript API that has already been subjected to a large volume of traffic and had necessary bug fixes applied. In most cases you should expect that no action is necessary when a version rolls over.
I'm again coming up against problems after picking up some tasks on CQ 5.3 but having used nothing but 5.6 before this.
My problem is with client libraries:
In CRXDE Lite in CQ 5.3 I went and set up my client libraries as I normally would at component level and /etc/designs/<project> level (using type cq:ClientLibraryFolder), however after including the line <cq:includeClientLib css="my.category"/> I got a jsp error stating the tag was not defined.
Sure enough, after a quick Google I found this tag wasn't introduced until 5.4, so my question(s) are:
How do you use client libraries in CQ 5.3?
If the answer to #1 is "you can't" then why on earth is the option available to set them up present in 5.3 CRXDE Lite?
Internet searches have turned up no information (or I'm searching for the wrong thing), hence my question here.
Thanks in advance
Yes, the cq:includeClientLib tag was introduced in 5.4 only.
But even without that you can include your clientlibs using the com.day.cq.widget.HtmlLibraryManager service.
The tag was just a convenience wrapper around this service interface.
HtmlLibraryManager htmlMgr = sling.getService(HtmlLibraryManager.class);
if (htmlMgr != null) {
htmlMgr.writeCssInclude(slingRequest, out, "my.category");
}
Refer HtmlLibraryManager API docs for the other methods that are provided.
I want to use Google API to transfer SharePoint Documents to Google Drive using dot net. For that to happen I want to use this link Google Quick Start.
I have followed every little piece of information. It states in beginning "Complete the steps described in the rest of this page, and in about five minutes you'll have a simple Drive app that uploads a file to Google Drive" but it is not true.
I am trying to run this sample example since yesterday but failed.
// Register the authenticator and create the service
var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description, CLIENT_ID, CLIENT_SECRET);
var auth = new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthorization);
So it seems that this code example is outdated and Google APIs have been upgraded.
Here comes the warning
[Obsolete("GoogleAuthenticationServer is not supported any more and it's going to be removed in 1.7.0-beta. Consider using the new Google.Apis.Auth NuGet package which supports .NET 4, .NET for Windows Store apps, Windows Phone 7.5 and 8 and Portable Class Libraries as well")]
Another code
var service = new DriveService(new BaseClientService.Initializer()
{
Authenticator = auth
});
And the error
Cannot implicitly convert type 'Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient' to 'Google.Apis.Http.IConfigurableHttpClientInitializer'. An explicit conversion exists (are you missing a cast?)
Then I was looking for [latest release samples] there I found the source files.
I was not able able to run the sample also.
Here I was successfully authenticated but then had error for redirect Uri
My Client_Secrets.JSON looks like, as you can see I have set default redirect Uri to http://localhost/.
{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"secret","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":email","redirect_uris":["http://localhost/"],"client_x509_cert_url":"aa#developer.gserviceaccount.com","client_id":"id","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","javascript_origins":["http://localhost:53404/"]}}
Now I can run this application but as mentioned getting error
Error: redirect_uri_mismatch
The redirect URI in the request: [[http://localhost:2430/authorize/]] did not match a registered redirect URI
I really don’t know from where this port number comes and from where this authorize comes. As you can see in my JSON, I have not set anything similar.
I am using VS 2010 SP1 Ultimate and Windows 7 home Basic.
I have tried to give complete information and my end goal is upload document in Google drive.
The tutorial you are following uses an older version of google.apis thats why you are seeing the not supported. Here are a couple of tutorials on how it works with the new version of the api.
http://daimto.com/google-oauth2-csharp/
http://daimto.com/google-drive-api-c/
Take a look in https://code.google.com/p/google-api-dotnet-client/source/browse/Tasks.ASP.NET.SimpleOAuth2/Default.aspx.cs?repo=samples. It's a Task API ASP.NET sample. As you can see you need to add several lines of code, but it works.
I downloaded the samples Eyal mentions and got that compiling before integrating with my own app. .Net needs to be 4 although it states it supports higher.
You have to set the redirect URI in the google developer console, not in your JSON. In your case, you would want to set it to http://localhost:2430/authorize/.
I am using this line:
call_api($_SESSION['sessionToken'],"https://www.google.com/analytics/feeds/accounts/default");
to get the details of my Google Analytics but it returns nothing. when i try to open:
https://www.google.com/analytics/feeds/accounts/default, it returns a 404 page, where can i see any changes on the Google Analytics API?
since is seems that a recent change on their part is causing this problem.
would someone be kind enough to explain this to me. or is it because of some changes on Google Analytic?
thank you :)
I'm not sure how old is your code. It seems to be using version 2.3 of the API
The current working versions are 2.4 and 3. Version 2.3 doesn't work anymore.
Here's the documentation for the latest version of the API.
https://developers.google.com/analytics/devguides/config/mgmt/v3/
And here's the changelog for the management API.
https://developers.google.com/analytics/community/mgmt_changelog
Here is a guide on migrating from 2.3 to 2.4. But you are encouraged to move to 3.0, some features only work on 3.0
https://developers.google.com/analytics/resources/articles/gdata-migration-guide
https://developers.google.com/analytics/devguides/config/mgmt/v2/#whatsnew