admin管理员组

文章数量:1220818

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?

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?

Share Improve this question edited Sep 30, 2015 at 13:25 Kelderic 6,6979 gold badges48 silver badges89 bronze badges asked Sep 24, 2009 at 9:39 Andy JacobsAndy Jacobs 15.2k13 gold badges62 silver badges92 bronze badges 2
  • 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 Commented Mar 20, 2016 at 18:14
  • 1 I also would like to make Google Maps API calls, and get result returned from My Maps – Kostanos Commented Sep 5, 2016 at 2:30
Add a comment  | 

3 Answers 3

Reset to default 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.

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.

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

本文标签: Add Google quotMy Mapsquot Layer to Google Maps Javascript APIStack Overflow