Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Forums Search:  


Author Topic: Google Maps supports KMZ  (Read 10210 times)

dbperry

  • Mapper
  • ***
  • Posts: 56
  • Karma: 3
    • View Profile
Google Maps supports KMZ
« on: December 13, 2012, 07:38:06 PM »
Google Maps supports KMZ files... but not perfectly. I did a quick search on these forums and haven't seen it mentioned, so I figured I would share what I learned.

I was actually introduced to this idea from a steward of one of the properties that I had created a KMZ for. He led me to upload the KMZ to my website to see how it would work in Google Maps. I can get this particular KMZ to display in Google Maps, but not properly. For some reason, Google Maps doesn't support the rotation. So the map is centered on the correct spot, but without the necessary rotation:
http://maps.google.com/maps?f=q&hl=en&q=http://www.dbperry.net/KMZ/Hemlock_Gorge_Ver_1.00.kmz

A little google searching reveals the problem:
https://developers.google.com/kml/documentation/kmlelementsinmaps
(note that KML element <rotation> is not supported)

and a potential solution:
https://groups.google.com/forum/?fromgroups=#!topic/kml-support-getting-started/nIC5DQr-Q4g

I understand Nymor's fix and I understand how I could do it. But I'm not going to bother...too much work for not much benefit, especially considering the incredible complexity of the massive Hemlock Gorge reservation... ;)

I uploaded my KMZ of Notchview, which doesn't need rotation, and that turns out pretty cool:
https://maps.google.com/maps?f=q&hl=en&q=http://www.dbperry.net/KMZ/Notchview_ver_1.00.kmz

I tried my Blue Hills KMZ, but it is too big. File size limitation is 3MB:
https://developers.google.com/kml/documentation/mapsSupport

The downside to this feature is that you need a website / server to host the raw KMZ file - obviously Google Maps can't support the zipped KMZ files that are hosted here.

But a pretty neat feature that I didn't know about before today!

Dave

Boyd

  • Expert Advisor
  • *****
  • Posts: 2847
  • Karma: 27
    • View Profile
Re: Google Maps supports KMZ
« Reply #1 on: December 13, 2012, 08:20:35 PM »
Pretty cool. I didn't know that was possible.  8)

-Oz-

  • Map Maker!
  • Administrator
  • Expert Advisor
  • *****
  • Posts: 1477
  • Karma: 19
    • View Profile
    • GPSFileDepot
Re: Google Maps supports KMZ
« Reply #2 on: December 16, 2012, 12:04:14 PM »
The non-rotated one looks pretty awesome.
Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110
See/Download My Maps!

dbperry

  • Mapper
  • ***
  • Posts: 56
  • Karma: 3
    • View Profile
Re: Google Maps supports KMZ
« Reply #3 on: June 21, 2013, 09:18:41 AM »
I continue my quest to become an expert KMZ file maker...but with all the IMG map creation expertise around here, I feel like becoming an expert at KMZ files is kind of like hanging out at a party of math PhD's and saying "yeah, but I'm REALLY GOOD at addition!"

Anyway....

1) workaround for Google Maps limitation on 3 Mb KMZ files: Since we (those of us creating KMZ files for Garmin GPSr) already have to use some kind of tool (I use MAPC2MAPC) to accommodate the Garmin limit of 1 Mb, we are halfway to the solution:
a) after creating the multiple tile KMZ file for the Garmin KMZ, create multiple smaller KMZ files with the right number of tiles to keep each KMZ file less than 3 Mb. (I have found that the best performance is actually with KMZ files less than 1.5 Mb). This is really easy to do if you have one KML file (from within your 'master' KMZ) that references all the tiles. You just use that KML as the basis for all of the KML files in the smaller KMZ files - just delete the references to the tiles not being used in each KML file associated with the multiple smaller KMZ files. Essentially you're building the multiple smaller KMZ files with a text editor to manually edit the KML files, and manually compiling the smaller KMZ files with a ZIP file editor.
b) Create a KML file with "network link" attributes that can be read by Google Maps.

This is all easier to understand with an example. See my "Middlesex Fells" KMZ here:
http://www.gpsfiledepot.com/maps/view/579/

The KML that is used to generate the Google Maps 'preview' is here:
http://www.dbperry.net/maps/fells.kml
You can download it and open it up in a text editor to inspect the syntax. Basically it is calling 10 separate KMZ files which 'tile' together to create the full map.
Unfortunately, the Google server 'reading' / 'loading' of KMZ files seems slightly unstable - sometimes you have to 'refresh' your browser a few times before all the tiles will load in.

2) The same "network link" attribute in a KML file can be used to display overlapping KMZ files. See this example:
https://maps.google.com/maps?f=q&hl=en&q=http://www.dbperry.net/maps/nw_fram.kml
(which are the maps in my Northwest Framingham "Bay Circuit "E to K" KMZ Series:"
http://www.gpsfiledepot.com/maps/view/607/

It even uses the draw priority of each KMZ to display the KMZ files in the correct / intended overlap!

3) There is a workaround to simulate transparency for KMZ maps in Google Maps. KMZ files support the GIF file format, and the GIF file format supports transparency. So you can:
a) convert your JPEG map to a GIF
b) replace the 'background' color of the GIF with 'transparent' pixels. Photoshop Elements or Photoshop can do this.
c) Create a KMZ file with the GIF file as the image.
d) When you load that KMZ file into Google Maps, it is "semi-transparent"

I tried this and it is pretty cool, but I didn't save my example, because...

I have abandoned this approach because Garmin does NOT support KMZ files made with GIF files. Garmin only supports JPEG. So I am going to focus my efforts on KMZ files that are compatible with the Garmin GPSr, which is my real reason for creating KMZ files. Too much extra work just to get transparency in Google Maps (although it does make the Google Maps KMZ implementation much more usable).

4) Finally, last, but certainly not least, I found the Gmap4 website, which (among other things) uses the Google Maps API to display KMZ files on all kinds of maps. For example:
http://www.mappingsupport.com/p/gmap4.php?q=http://www.dbperry.net/maps/nw_fram.kml

Notice the menu in the upper right corner - you can choose 13 different 'foundation' maps as the background!

Lots of neat features on the Gmap4 website: http://www.mappingsupport.com/p/gmap4.html

My next project will be to create an interactive, hot-linkable Gmap4 map with all of my KMZ maps. In other words, a big (small scale) view of New England with all of my KMZ maps displayed. Clicking on each KMZ map will bring you to the correct GPSFileDepot page where you will be able to download the Garmin compatible KMZ.

Fun stuff!

Boyd

  • Expert Advisor
  • *****
  • Posts: 2847
  • Karma: 27
    • View Profile
Re: Google Maps supports KMZ
« Reply #4 on: June 21, 2013, 09:49:12 AM »
Cool stuff again!  8)

I continue my quest to become an expert KMZ file maker...but with all the IMG map creation expertise around here, I feel like becoming an expert at KMZ files is kind of like hanging out at a party of math PhD's and saying "yeah, but I'm REALLY GOOD at addition!"
Well you do have a little company here.... My New Year's project was learning the basics of javascript and the Google API. I built this site in about a week using USGS NED 1/9 arc second data rendered in Globalmapper and combined with the road, hydro and POI data as used in my vector based maps.  :)

http://boydsmaps.com

Have been meaning to get back to this but am too easily distracted by other things. But I like the idea of using the web for maps because they are easily accessible to everyone with a couple mouse-clicks and don't require downloading or a gps device. However the next step with this site will be to add a custom maps download capability. Should be very straightforward, I will just break it into USGS quads. At full resolution (about 10 ft per pixel) a 24k quad will require 16 1024x1024 tiles (4x4), so you could load 6 quads on the older devices or 31 on the Montana or Oregon 6x0.

Actually I would like to investigate other mapping API's, preferably open source. For what I'm doing, I don't need any of the google features like geocoding or basemaps. I just need a straightforward way of putting a map in a browser window.
« Last Edit: June 21, 2013, 09:59:11 AM by Boyd »

BobT

  • Mapper
  • ***
  • Posts: 60
  • Karma: 2
    • View Profile
Re: Google Maps supports KMZ
« Reply #5 on: June 21, 2013, 09:55:51 AM »
I've only got one thing to say.  2 + 2 = 4.  That's my contribution to this intriguing thread.

CliftonLindsey

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: Google Maps supports KMZ
« Reply #6 on: August 19, 2013, 01:39:53 AM »
Google Maps supports KMZ files... but not perfectly. I did a quick search on these forums and haven't seen it mentioned, so I figured I would share what I learned.

I was actually introduced to this idea from a steward of one of the properties that I had created a KMZ for. He led me to upload the KMZ to my website to see how it would work in Google Maps. I can get this particular KMZ to display in Google Maps, but not properly. For some reason, Google Maps doesn't support the rotation. So the map is centered on the correct spot, but without the necessary rotation:


A little google searching reveals the problem:

(note that KML element <rotation> is not supported)

and a potential solution:
started/nIC5DQr-Q4g

I understand Nymor's fix and I understand how I could do it. But I'm not going to bother...too much work for not much benefit, especially considering the incredible complexity of the massive Hemlock Gorge reservation... ;)

I uploaded my KMZ of Notchview, which doesn't need rotation, and that turns out pretty

I tried my Blue Hills KMZ, but it is too big. File size limitation is 3MB:


The downside to this feature is that you need a website / server to host the raw KMZ file - obviously Google Maps can't support the zipped KMZ files that are hosted here.

But a pretty neat feature that I didn't know about before today!

Dave
yes it supports KMZ files and it perfectly runs on my iPhone.. Very useful indeed