51

Is there any way to add Layers, Points, Directions or any data to a map in the Google My Maps, using API?

I have searched in Google but didn't find a solution to do this.

3

2 Answers 2

48

Currently there is no any API to access MyMaps programmatically.

I can see a feature request for this in the public issue tracker:

https://issuetracker.google.com/issues/35820262

It looks like Google is evaluating the feasibility to implement the API, however, no timeline provided at the moment.

Please star this feature request to express your interest and receive further updates.

UPDATE

As of April 2018 it looks like Google decided do not implement the API for Google MyMaps and marked the aforementioned feature request as Infeasible.

2
  • 9
    Note the ticket is re-opened as of Feb 2021
    – user212328
    Apr 6, 2021 at 11:21
  • 2
    Indeed it is now Assigned Status - fingers crossed!! Oct 18, 2021 at 10:05
1

This is not a fantastic solution — and it does not use the API — but it might fit your needs. Instead of using the API you could write a browser console script that adds each new item. You could probably even run this through a headless browser and remove any manual interaction altogether.

eg.

fetch('https://example.com/newLocations')
  .then((response) => response.json())
  .then((newLocations) => {
    newLocations.forEach(location => {
      document.querySelector("#mapsprosearch-field").value = location.name + ", " + location.city; 
      document.querySelector("#mapsprosearch-button > div").click();
      document.querySelector("#addtomap-button").click();
      // etc.
    });
  });

UPDATE

Re-opened as of Feb 2021 — API support for this has been assigned. So hopefully we get support soon! https://issuetracker.google.com/issues/35820262

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.