23

I want to put a Google Maps map on our website.

I know that custom markers can be added to a map with Javascript, but I'd rather use Google's MyMaps service instead, because then my co-workers could edit the map without any programming knowledge.

You can add a custom My Map to websites with an embedded iframe. I'm using the Javascript API instead though, so that I can take advantage of the controls the API delivers (such as zoom through custom controls or changing the position on the map without touching the map itself).

Can I insert the map created and saved with My Maps as a layer in my JS API map?

Kelderic
  • 6,502
  • 8
  • 46
  • 85
Andy Jacobs
  • 15,187
  • 13
  • 60
  • 91
  • I have the same issue. Since Google Maps Engine has been deprecated, I would like to use Google My Apps to create a Map with points coming from an Excel file that can be updated at any time, and showing that map from a Web App using Google Maps Javascript API. I'm researching how to implement the Front End integration, so keep in touch, If I have a solution I will post it here. – rtrujillor Mar 20 '16 at 18:14
  • 1
    I also would like to make Google Maps API calls, and get result returned from My Maps – Kostanos Sep 05 '16 at 02:30

3 Answers3

6

You can use GGeoXml to add My Maps content to your API map.

In your My Map there's a "View in Google Earth" link, use the URL of that link as your GGeoXml URL.

The link generates an indirect "network link" reference to the data, so the map on your page will reflect the latest changes made to the My Map.

The downside is that there's a limit to how many markers you can place on one page of a My Map, and the "View in Google Earth" link only returns data for the current My Maps page.

max
  • 96,212
  • 14
  • 104
  • 165
Mike Williams
  • 7,739
  • 2
  • 24
  • 12
1

Another strategy is to use GeometryControls in your own API map.

That involves a lot more coding effort on your side. It gives the same look and feel to your co-workers, so they still need no programming skills. The advantage is that it bypasses the My Maps limit to the number of markers that can be displayed at once.

Mike Williams
  • 7,739
  • 2
  • 24
  • 12
-1

Apparently you can embed the My Map you created in your website by using the Link To This Page functionality as described here.

Tom van Enckevort
  • 4,170
  • 1
  • 25
  • 40
  • i'm aware of that, but how can you then take advantage from the GM api ? – Andy Jacobs Sep 24 '09 at 09:54
  • When you use the generated embedded code you do get the zoom controls, Map/Sat/Terrain buttons, etc. What additional functionality are you referring to? – Tom van Enckevort Sep 24 '09 at 10:20
  • What exactly would you want to control from JavaScript? Because you can specify the zoom levels, position, controls, etc. from the query string of the iframe, and the custom markers are added through the My Maps interface on the Google site. – Tom van Enckevort Sep 24 '09 at 11:21
  • at runtime i want to change the zoom level and position with javascript, but i think i'm going to slip over to json and a custom database – Andy Jacobs Sep 24 '09 at 11:28
  • 1
    @TomvanEnckevort where can i find the query string settings to change the controls? – Joaolvcm Feb 06 '15 at 15:29
  • @JoãoMelo I'm not sure you can control that, but have a look here: https://developers.google.com/maps/documentation/embed/guide#forming_the_url for more information. – Tom van Enckevort Feb 08 '15 at 19:00