I'm having some issue with static Google maps generation. The API has "a query limit of 1000 unique (different) image requests per viewer per day. Since this restriction is a quota per viewer, most developers should not need to worry about exceeding their quota".
However when using a shared connection, as instance with a mobile phone and a 3G access (phone operators), this limit seems to be problematic.
Hence my question is the following: can I retrieve the image server-side and serve it to my clients? Is it allowed?
This FAQ indicates not: Can I generate a map image using the Google Static Maps API which I store and serve from my website?
Text (as of November 2016):
Can I generate a map image using the Google Static Maps API which I store and serve from my website?
You may not store and serve copies of images generated using the Google Static Maps API from your website. All web pages that require static images must link the src attribute of an HTML img tag or the CSS background-image attribute of an HTML div tag directly to the Google Static Maps API so that all map images are displayed within the HTML content of the web page and served directly to end users by Google.
Actually, you can. Reference the Google Maps TOS:
3.2.4 Restrictions Against Misusing the Services.
(a) No Scraping. Customer will not extract, export, or scrape Google Maps Content for use outside the Services. For example, Customer will not:(i) pre-fetch, cache, index, or store Google Maps Content for more than 30 days; (ii) bulk download geocodes; or (iii) copy business names, addresses, or user reviews.
(Edit: Updated to reflect the latest terms as of June 2018.)
This is discussed in further detail in the "Sanity Checks" aspect of Google Static Maps Usage Limits.
As of Oct 21 2021, both ToS and FAQ are speaking the same language. Storing and serving copies of images generated using the Google Static Maps API from your website is not allowed.
ToS
3.2.3 Restrictions Against Misusing the Services.
(a) No Scraping. Customer will not export, extract, or otherwise scrape Google Maps Content for use outside the Services. For example, Customer will not: (i) pre-fetch, index, store, reshare, or rehost Google Maps Content outside the services; (ii) bulk download Google Maps tiles, Street View images, geocodes, directions, distance matrix results, roads information, places information, elevation values, and time zone details; (iii) copy and save business names, addresses, or user reviews; or (iv) use Google Maps Content with text-to-speech services.
FAQ
Can I generate a map image using the Maps Static API which I store and serve from my website?
You may not store and serve copies of images generated using the Maps Static API from your website. All web pages that require static images must link the src attribute of an HTML img tag or the CSS background-image attribute of an HTML div tag directly to the Maps Static API so that all map images are displayed within the HTML content of the web page and served directly to end users by Google.
I find the TOS pretty contradictory
Can I generate a map image using the Google Static Maps API which I store and serve from my website?
You may not store and serve copies of images generated using the
Google Static Maps API from your website. All web pages that require
static map images must link the src attribute of an HTML img tag or
the CSS background-image attribute of an HTML div tag directly to the
Google Static Maps API so that all map images are displayed within the
HTML content of the web page and served directly to end users by
Google.
https://developers.google.com/maps/faq?csw=1#usagelimits
Related
In my angular webapp I store the lat and lon of a position.
I need to send an email to a user with some information including a Google Maps with a mark in (lat, lon) and some style for the maps like the zoom.
How can I include a Google Maps in my email with a mark?
Thanks
In my previous project I had a similar requirement.
I made use of the google maps static API, which returns an IMG by request.
Static API Doc´s
Now you have to decide if you wish to save the IMG to the filesystem and send it then via email, or if you just the IMG string and use this for your email.
If you wish to do it without saving the IMG to the filesystem take a look here:
Embed Image in Mail
Otherwise it would be a normal email, how to do that is pretty good explained the Doc´s.
Good Luck!
How to access my google drive images from app script html file so that i can use those images in my img tags something like src= "https/googledrive/folderID/imagename.png"
I have not able to find any relevant answer.Please help!
you cant. ok you can but only for a few more months as google has deprecated "google drive hosting" (google that if you still want to use it)
instead you can use another free google hosting like a google site. put images in a file cabinet page and make the page public. like this image:
https://sites.google.com/a/plusfortrello.com/images/img/bubble-sprite.png which is the cabinet site plus plus the image name appended.
sites images have disadvantages like lack of caching and slow GET. you can greatly speed it up using a (paid) Google Cloud Storage bucket mentioned in this blog post of mine: http://zigmandel.blogspot.com/2015/09/how-i-crowd-translated-my-product-tour.html
I'm trying to create a map of customer locations using Google maps.
It would be very convenient to display customer information in the balloons that pop up when you click a marker. However, some of that data should not be public, and the company would rather not disclose it to Google either.
I have access to (and can set up a server if need be) that runs something server side to generate .kml, Javascript, or serve a web page (including the js in that).
I've thought of a few ways to go about this. First is embedding html in .kml and having the contents of the balloon replaced by JavaScript making an asynchronous request to a private url/server. Unfortunately, it looks like JavaScript is stripped out if you are loading a .kml file by just putting the URL of the .kml file in the search box of google maps. I also found that it seems that iframes are also stripped out. One thing I do not know is if I set up a xhtml page that uses the Google maps API if that would let me load data from a private server directly to the browser without that data being loaded through Google.
One option that appears it will work is just putting a link in the .kml html for the balloon and having that link go somewhere. But that makes a whole extra step to see what the marker is, and diminishes the value of the whole thing in the first place.
So, is there a way to do what I'm attempting to do (load private data into the placemark bubbles directly to the user's browser instead of through Google)? If so, which option is the most maintainable/clean?
With Google's map API, you can write an (x)html page that loads a google map using javascript.
You can then have that javascript load data from a server directly to the browser (in something like JSON or XML) where the javascript can parse it and then add each point to the map. That way, the data does not route through Google's servers.
I just had an idea to have a collaboratively worked-on public Google Drive document's contents displayed on my Web site. I was hoping this would be straightforward, as I am only going to extract simple text and the document is public, so no authentication shenanigans will bar my way.
I have looked at Google Drive REST API, but turns out I can only get file metadata and/or the entire document file. Not just the document content.
I do not wish to spend a day coding to do this, I thought it would be nice to have, but can live with just linking into the file directly from my Web site. Anyone tried this before? Anyone experimented with Google Drive API and has a feel for how much work would be involved?
If you are thinking of getting the content of a native Google document (like a Google spreadsheet or a Google doc), this is currently possible with the Drive API.
In the Drive API, for Google native document types you will have a series of 'exportLinks' as part of the metadata of the file. Each of these export URLs allow you to download the content of the Google document in a specific export format (like RTF, plain text, HTML, PDF etc...). Updating my answer...
See the documentation for this: https://developers.google.com/drive/manage-downloads#downloading_google_documents
In my meeting management application, I am trying to send the meeting location information via mail and in the mail content I would like to place a link to to the google map site, so that the meeting place could be seen on the map.
What would be the best way to construct the google map url string (eg. http://maps.google.com/maps?q=address) , for a particular address.
Thanks
Reducing the clutter of arguments to a minimum, this seems to work pretty well:
http://maps.google.com/maps?q=1+infinite+loop,+cupertino,+CA