6

I would like to make a script that:

  1. Creates a Google Map (daily)
  2. Adds placemarks through Lon/Lat in a CSV-file
  3. Saves the map (and make it public) to my Google Account.

using the Google Map API. This is very easy to do manually but is it possible to do using the API? I can only see how to add a Google Map to your website, and the likes of it.

Let's say for example that I want to make a daily map of armed robberies in the USA. I have a CSV file with all the locations (as Lon/Lat). I want to create a map at 0.01 a.m. that can be shared on social media (for example using Twitter API to share the location of that map). I do not want to use a website in the process.

Is this possible? How can I do that? I am using Ruby on Rails but I am more interested, at this point, to see how this can be done in any script or pseudo-code.

Christoffer
  • 2,271
  • 3
  • 26
  • 57
  • Which API? Google MyMaps is the only possibility I can think of, but for MyMaps there is no API implemented. The only alternative may be uploading a KML file through the Drive API. KML files are viewable on Google Drive as Google Maps overlays. – LuisTavares Jun 01 '19 at 05:14
  • Hmm, I was under the impression there was only one API. No matter what, it doesn't matter as long as it solves my problem in a fairly easy/elegant way. – Christoffer Jun 03 '19 at 08:35
  • Maybe just passing the coordinates in the url will solve your problem: https://stackoverflow.com/questions/35400664/google-maps-multiple-markers-via-url-only – LuisTavares Jun 03 '19 at 19:36
  • It is somewhat of a solution and could possibly work as a workaround but this is directions and does not add those placemarkers that make it easy to see. If there is nothing else, I guess this might work but I really would like to use ordinary placemarkers. I can't believe this isn't easier! – Christoffer Jun 06 '19 at 13:17
  • On the second answer of the link I pointed you have the solution without directions – LuisTavares Jun 06 '19 at 21:49
  • There is a link to it but that article doesn't mention anything about multiple markers or anything that would help me out, unfortunately. – Christoffer Jun 10 '19 at 20:05
  • I was mentioning the answer that says ` just add at the end: //@ ` – LuisTavares Jun 11 '19 at 01:02
  • Oh, I see what you mean now. Thanks, it seems to be somewhat of a solution but with some flaws. It is still a direction and once you remove the window to the left, you don't see the markers any longer for example. It could work as a temporary solution but I still want to find a way to solve this with real placemarks. – Christoffer Jun 13 '19 at 17:18
  • The third requisite: saving to your Google account, is the only one that looks like not being trivial. – LuisTavares Jun 13 '19 at 19:38
  • 1
    Exactly, Luis, I am not sure if this is possible and this is what I need to figure out. – Christoffer Jun 25 '19 at 05:32
  • Is there any update on this? Has anyone found a solution? – Quinn Keaveney Oct 03 '22 at 23:58

0 Answers0