Export all MyMaps to Google Earth


Update, 2nd August 2008

Suddenly it seems that the KML export from My Maps no longer pages like it used to, basically making this script redundant – which was always the intention!

So if your file has under 1000 features, then just use the link ‘View in Google Earth’ to get all the data. If you want the
actual data you can change the ‘output=nl’ to ‘output=kml’ to get the KML data rather than a Network Link to it.


Oh dear, I think I should stay away from the Google Maps Group, following a post (about saving directions to MyMaps) on there a few days ago, realised the KML export is paginated, but there doesnt seem to be a way to get at the following pages directly. It flummoxed me for a while until guessed at the params to get the additional pages, success.

Then a post on there today, made me realise others are coming against this problem, so in traditional hackers** style, here is a little utility to create a multi page network link wrapper…

Export all MyMaps to KML

** follow the link for the definition I mean

Update: 18th Apr, we now download the first page of the map, 1) to get the number of items per page, it seems the link itself is no longer reliable, and 2) it means we can grab the title automatically :)
(note the download is discarded so I dont keep a copy of the data itself)

17 Responses to “Export all MyMaps to Google Earth”

  1. It would be simple to use atom:links to point to other KML pages. This is what we do in Mapufacture for returning large KML files and it works well.

  2. steve white says:

    I have created a new mymap and imported a map but it has 6 polygons only 5 appear, there is no google logo with the option to move the next page. so a polygon is missing. argh googlemap is deadly but fiddly.

    any thoughts

    does your leet skills allow you to find the link to show all polygon on one page on one map?

    when I go back to it and check it in my list I can no longer see the list in the sidebar below with import, title, description and collaborate options

  3. steve white says:

    + I tried to add the missing polygon by importing that in a file on its
    own, but it only created another seperate map and then the missing
    polygon and the uploaded turned up in it…

  4. Barry says:

    @Andrew, only just spotted this comment. Do you you have an example? Will try forwarding to google so they can implement it :) But I guess it just adds the links so that parsers that know about it can follow, its not a general solution at the moment?

    @steve, not sure what you mean, Are you trying to import a KML from somewhere INTO a MyMap? And are you really using the import process, rather than just using the URL in the search box?

    You can usually run the Import on a map with content already, and its just added to the end.

  5. steve white says:

    im creating a new map importing a kmz that I madein GE, it has 6 polygons,only 5 show up on the map and list on the sidebar the 6th polygon happens not fit in the lower left hand sidebar (it has no scrollbar). so it doesn’t show on the map? and it doesn’t allow me to click to the next page on the list or anything?

    can you see this


  6. carl says:

    Steve, I’ve seen the pagination links disappear from the left-hand frame when logged-in and editing various polygons. My suggestion is to close the browser and navigate back to your map. The page links should come back.

  7. carl camera says:

    barry, I am getting a different response when trying to generate the kml from the nearby tool. I right-click the “2″ link at the bottom of the left-side frame and copy and paste that url into the kml generator, but it reports: There doesn’t appear to be more than one page.


  8. Matt says:

    Same as Carl. I paste the page 2 link and get “there doesn’t appear to be more than one page”

  9. Barry says:

    oh missed the second comment from carl :(

    Matt and Carl, looking at those links they report num=200 which suggest 200 results per page, but is clearly wrong from that you report 2 pages, and only start at 32…

    For now have made it that if ‘start’ is lower than ‘num’ it will use that number, which of course is fine for 2 pages, but if more it wont work.

    I guess Google have changed something that the ‘num’ is fixed, but it does mean that the script no longer is reliable :(

  10. Barry says:

    Well realised the script could actully download the first page and count how many items are really fetched that way it can calculate it all magically! (you still need to paste full last page url as we need it to get the number of pages)

  11. Three Wheeled says:

    I was directed to your page through a request for help on Google help groups. My problem was that due to my map going over 200 markers and beign displayed on two pages, I was losing a very detailed boundary line. I wanted the boundary line to be able to appear on both pages, without having to re-plot it. However, somebody directed me here (presumably to get around the 200+ markers problem).

    Your code works very well, and even allows me to see both pages at once, but when I view my map through the code, certain of the markers don’t appear unless I deselect, and re-select the display buttons that you mark on the right of the map. Eg. it says it displays everything, but it seems that there’s an odd kind of limitation.

    Are you able to be of assistance? (Not sure if this is Google maps amending your hack, or something to do with the hack itself)

  12. Barry says:

    It still doesnt display everything – the browser will not cope with too many features on the screen at once – the map just gets too slow.

    The advantage of this method of display is that Google Maps uses a regional culling method. Basically it tries display a good overview, then zooming in will reveal more detail and features.

    If you really want to get round it you can use the Google Maps API to create a map, and use a different KML parsing method (ie not Googles GGeoXML) then you can display all the features you like, just that your map will be slow to use.
    (in fact if you really do want it on Google Maps website, then you might be able to make it as a maplet – that probably doest impose limits – just again the map will become slow)

  13. Barry says:

    Update, 2nd August 2008

    Suddenly it seems that the KML export from My Maps no longer pages like it used to, basically making this script redundant – which was always the intention!

    So if your file has under 1000 features, then just use the link ‘View in Google Earth’ to get all the data. If you want the
    actual data you can change the ‘output=nl’ to ‘output=kml’ to get the KML data rather than a Network Link to it

  14. ehg says:

    Hi Barry,thank you very much for your invetsigations & the clarification of this limitation-matter

  15. Mike says:

    I can successfully merge all my placemarks onto one map however when I do so it now sorts alphabetically instead of chronologically per my original KML file. It is a travel blog so chronological is key. Am I missing something?

    Original Map : http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=103255705685677832404.000451ea7fd78d07190f1&z=2

    New Map : http://maps.google.com/maps?q=http%3A%2F%2Fwww.nearby.org.uk%2FallMyMaps%2F48a3ff27afba3.kml

    My Original KML File : http://trinity.murphy.googlepages.com/rtw_mapv3.kml

  16. Barry says:

    @Mike, as per the recent update this script is no longer needed.

    But anyway this script doesnt process any data, it seems that Google do this, they sort the KML export of the My Map.

    You can see this directly without using the script (as you should now anyway)

    But are yuo aware you can bypass My Maps totally:

    However it appears that also sorts, so it appears only My Maps maintains order, if you display your KML (either directly or the output of a My Map) via Google Maps then it will end up sorted. SOL

  17. deepa says:

    how to export what ever digitised on mymap
    where is that option?????????