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
2009-12-25 09:36:53
Is Google service of converting kmz to kml available to the public? That will solves the problem.Thank you.
2009-12-25 09:40:39
I just realized your name. I was reading your articles before a while :)
2009-12-25 09:47:13
It seems http://maps.google.com/maps/gx offer the conversion service but no documentation is available. Anyone knows how it works?
2009-12-25 18:34:16
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
2010-02-16 19:02:20