0

I'm wondering what is the best way to use the data from Googles' My Maps with geoxml3. At the moment it is only possible to export kmz data format from My Maps. I used the exported kmz with the geoxml kmz version (http://geoxml3.googlecode.com/svn/branches/kmz/) but couldn't make it work (but it worked when I loaded it in Google Earth and saved it again as kmz!). I also tried it with the network link to My Maps (which I would like best), but no success, just got the message "XMLHttpRequest cannot load http://www.google.com/maps/d/kml?mid=........." . Google doesn't semm to allow this anymore?

best greetings from Berlin ralf

  • The KML/KMZ needs to be on the same domain as the web page or accessed through a proxy. Do you have an example Google My Map you can provide a link to? – geocodezip Apr 25 '15 at 13:25
  • Link to simple My Maps example is https://www.google.com/maps/d/edit?mid=zRlyQCuWJlxY.kzodUy9plTB0 ...but the problem seems to be the exported kmz from Google. It's not working with geoxml3, – ralfwessels Apr 25 '15 at 14:06

1 Answers1

1

Google is making it harder to do this. It works directly with KmlLayer

If I do the following, I can display the data using geoxml3:

  1. download the "network link" kmz file
  2. That KMZ includes the following link:

    http://mapsengine.google.com/map/kml?mid=zRlyQCuWJlxY.kzodUy9plTB0&lid=zRlyQCuWJlxY.kcCknmQlcl24

  3. That link redirects to

    https://mapsengine.google.com/map/kml?mid=zRlyQCuWJlxY.kzodUy9plTB0&lid=zRlyQCuWJlxY.kcCknmQlcl24

  4. I can download that KMZ file, but it doesn't work directly with geoxml3, I need to unzip it and zip it up again. I think it is because the zip branch of geoxml3 doesn't support the particular kind of zip encoding google is using.

example of KMZ

example of KML

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • hi geocodezip, thanks for that quick answer. So the problem is the kind of zip encoding google is using and I can't use the exported kmz directly and also not the network link through a proxy! I guess I have to unzip and zip the exported kmz before use with geoxml3. But here I'm facing another problem: special characters (e.g Ä, ?, ü ....) become different while unzipping/zipping the kmz as you can see in your examples. kml is ok, but special characters in kmz example are destroyed. Is there a way to solve this problem? – ralfwessels Apr 25 '15 at 15:17
  • The characters issue is a character encoding issue which is separate from the geoxml3 issue. I think I have seen a question/answer here on SO that should resolve that. – geocodezip Apr 25 '15 at 15:18
  • when trying to solve this special character problem, I figured out, that I also have this, when creating a file in Google Earth (with special characters), save it as kmz and use this with geoxml3. So it has nothing to do with unzipping/zipping a kmz. I suppose the wrong encoding has to do with the ZipFile.complete.js library which is unzipping the kmz file. – ralfwessels Apr 25 '15 at 16:57
  • may you can give me a hint to the question/answer here on SO, that solves the character encoding problem? – ralfwessels Apr 26 '15 at 20:34
  • perhaps these: https://www.google.com/?safe=active&ssui=on#q=site%3Astackoverflow.com+character+encoding+Dr.Molle&safe=active&ssui=on – geocodezip Apr 26 '15 at 20:56
  • at least I solved the special charcter problem using "decodeURIComponent(escape..... I found a good post here on SO: http://stackoverflow.com/questions/5396560/how-do-i-convert-special-utf-8-chars-to-their-iso-8859-1-equivalent-using-javasc I added the lines placemark.name = decodeURIComponent(escape (placemark.name)); placemark.description = decodeURIComponent(escape (placemark.description)); to the geoxml3.js (kmz branch) behind "placemark = {....". Don't know, if this is the best position, but it works!! – ralfwessels Apr 28 '15 at 08:58
  • Thanks, created an issue in geoxml3 to capture this: https://code.google.com/p/geoxml3/issues/detail?id=110 please add any details you might think are relevant. – geocodezip Apr 28 '15 at 13:29