views:

1119

answers:

3

I want to put a google maps on our website,

i know you can add custom markers with javascript onto your map. but why do that through code if you got my maps ? my co-workers can edit the public created my map easily, add / delete markers without any programming knowledge

you can add that custom map my map to your site with an iframe But can you add it with the google maps api? so you can take advantage of the controls the api delivers such as zoom through custom controls, change the position on the map without touching the map itself.

but with the markers all in place that come from the my map i created

A: 

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

tomlog
i'm aware of that, but how can you then take advantage from the GM api ?
Andy Jacobs
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?
tomlog
control from javascript :)
Andy Jacobs
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.
tomlog
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
+2  A: 

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.

Mike Williams
A: 

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