I have used Google maps,places,directions javascript API in my web application. Application loads different places based on user input by making ajax call to the google api. Fortunately Google is able to crawl the ajax lately.
When I was checking the URLs in the Googles webmaster tool 'Fetch as Google' feature, the response is like below
Here is the google maps api robots.txt file
Is google maps api blocking Google bot? in that case please suggest me what would be approach should I follow to to get the page content?
We took contact with Google Maps Support and they confermed it was a bug at their side! However, no statements were made about when we could expect a fix.
Related
I currently have an application which takes a a start and end point from a user and sends a request to the google maps directions API, for example: https://maps.googleapis.com/maps/api/directions/xml?key=my_key8&origin=M460PU&destination=NN36NW&sensor=false&mode=driving&units=imperial&departure_time=1501752779
We then display the estimated journey time for a given route. The user has asked if it's possible for us to include a link directly to Google maps so that they can see the route on the maps and make sure it looks ok.
I've seen previous questions such as this one: Link to Google Maps but that seems to be a solution for a simple Google Maps search, where as in my case I want to see a route from the directions API.
I'm trying to figure out if I there's a way I can take the data from the Directions API response and plug that in to a http://maps.google.com/maps URL that the user can click on. Has anyone ever had any success doing this?
As mentioned #geocodezip you should use Google Maps JavaScript API or Google Static Maps API in order to show exactly the same route as the output of Directions API.
There is also an option to open Google Maps web site or native app using the Google Maps URLs. You can have a look at the documentation to figure out how to create the URL:
https://developers.google.com/maps/documentation/urls/guide#directions-action
The only issue is that the Google Maps URLs doesn't provide any parameter for departure time, so you will always get routes for "Leave now" that might have discrepancies comparing to a web service that was requested for a different departure time.
Based on your question I think the Google Maps URL might be
https://www.google.com/maps/dir/?api=1&origin=M460PU&destination=NN36NW&travelmode=driving
I'm displaying Google maps in China, the API there uses HTTP. However, my website is HTTPS.
Chrome, and any other mainstream browser throws a Mixed Content error.
How do I overcome this?
Was not able to find an easy solution with Google Maps.
However, using Gaode Maps ( 高德地图 ) helps was an alternative for Chinese based clients on sites HTTPS is needed.
They have an SDK with English instructions and similar functionality and coverage to Google Maps.
It is slower than Google Maps for non-China based users but is still okay to use.
You could detect the user's location and use Google Maps and Gaode Maps as needed.
On Google Drive documentation I could see schema for individual resources like File,Permissions etc but no where mentioned about API for meat data of all resources.
The Discovery Service API is an interesting if little known API it gives you all the information you could ever need about Google APIs.
If you take the following command and place it in a web browser you will see everything you could ever want to know about the Google Drive API v3.
https://www.googleapis.com/discovery/v1/apis/drive/v3/rest
I have requested a link for embedding google maps on my website on
https://developers.google.com/maps/documentation/embed/start
and have authorized everyone with the link to use it
Referers: Any referer allowed
https://code.google.com/apis/console/
but I still receive a
The Google Maps API server rejected your request. This API project is not authorized
to use this API. Please ensure that this API is activated in the APIs Console:
Learn more: https://code.google.com/apis/console
Is there some other way to test my website locally with embedded google maps?
EDIT:
They say:
Easy embedding
Google Maps Embed API maps are easy to add to your webpage—just set the URL
you build as the value of an iframe's src attribute. Control the size of the
map with the iframe's height and width attributes. No JavaScript required.
but I still can't access the link.
The problem was that they have their "quick start" out of date.
https://developers.google.com/maps/documentation/embed/start
It says you should only provide them with your API key but the thing is that there is a new version of the same website which they don't have links to from their guide but which you get a link to elsewhere( I got offered when in "billing" )
The new service is called Cloud Console and I found the API on/off buttons there.
https://console.developers.google.com/project/...
You have to enable the "Static Maps API", "Google Maps API" and "Google Maps Embed API" and make sure to have your link in an iframe div
As Dominik said, go here:
https://console.developers.google.com/project/%your-project-name%/apiui/apis/library?q=google%20maps
Enable both APIs:
Google Maps Embed API
Static Maps API
Then go here:
https://console.developers.google.com/project/%your-project-name%/apiui/credential
Create New Key
Browser Key
And you're done.
I also had to enable the Google Maps JavaScript API.
Despite loading the Google Maps API, via this url:
http://maps.gstatic.com/intl/en_ALL/mapfiles/276b/maps2.api/main.js
I'm getting the above error.
Why is it that when I download that URL in my browser and do a find for 'GOverlay' I'm getting zero matches?
Have Google removed this from their API or something, causing all my code to break?
GOverlay is an essential part of the Google Maps API implementation, see the V2 documentation for GOverlay here.
The reason for you not finding "GOverlay" when searching through the Javascript file you provided is simply that the Google Maps API consists of several Javascript files, not all of the code is in main.js. Additionally the code is obfuscated which could mean the build GOverlay by concatenating some crazy strings.
On a basic note: Why do you want to use some static JS file? The offical way to use the Google Maps API is using a key, which you have to obtain by registering with your Google account. So actually the URL you should be using is:
http://maps.google.com/maps?file=api&v=2&key=abcdefg
Or use the AJAX loader as seen on the Google Maps V2 documentation here.
The code is actually loaded asynchronously.
Post a link to your page - it is more than likely that there's some issue with your code.