I have a google sheet and I have cell B1
called Address
which contains:
405 E 42nd St, New York, NY 10017
I would like to embed a google map into my google sheet in cell D5
that looks like this:
Note: I don't need other landmarks, but if they are there it won't bother me.
Research:
I googled it, and came up with zilch. I found code on how to import an image, but that's not the hard part. The hard part is getting the image of the map, or better yet, embedding a live dynamic map that changes when the address on the sheet changes (preferable).
I can use this api to get a static image:
but I don't know how to get it into the sheet.
Best Answer
Tl;Dr
Try
=IMAGE(url)
and if that doesn't work as you need it use Google Apps Script and the Google Maps Static API to insert the map as an OverGridImage object.Few weeks ago Google announced that now is possible to insert an image into a cell. Below is the insert image into a cell dialog:
I don't think that it could be used to automatically update an image when a cell value changes. That could be done by using
IMAGE
built-in function if the image is public. As the Google MAP Static require an API key and because it response could exceed the time execution limit ofIMAGE
, it could me more reliable to use Google Apps Script but it's known that on edit triggers works on a "best effort" basis (meaning that now always are triggered like when a several cells are updated in short time)To use Google Apps Script
B1
(or any other cell that you want to use as trigger) is edited by a user by using the Google Sheets UI.