views:

201

answers:

1

Can Google Map API GXml parse .kmz files directly? if not how is the best way to convert .kmz file to .kml? The .kmz file is stored on database and PHP code is used to retrieve it.

A: 

I'm pretty sure that there's no way to unpack zipped data with Javascript, which you'd have to do before passing the data to GXml.parse.

GGeoXml can handle KMZ files. It does it by passing the URL to a Google server which unzips the data and parses it there, then returns the individual overlay objects to the Javascript client.

Since you're reading the data with PHP, you might consider unzipping it in your PHP script, and serving the unzipped data to the client. You may need to do some work to your PHP configuration in order to enable the PHP Zip File functions.

Mike Williams
Is Google service of converting kmz to kml available to the public? That will solves the problem.Thank you.
I just realized your name. I was reading your articles before a while :)
It seems http://maps.google.com/maps/gx offer the conversion service but no documentation is available. Anyone knows how it works?
Google Maps currently has specific limitations to the size and complexity of loaded KML files. Current limits:http://code.google.com/apis/kml/documentation/mapsSupport.html
geographika