How I can read the content in a KMZ (not KML) with JavaScript?
Asked
Active
Viewed 8,355 times
3
-
um.... so which is it? KML per your title, or KMZ per your question content? – Jason S Aug 17 '10 at 01:55
-
Do you actually want to do something with the KML inside the KMZ (which is simply a ZIP file) with your JavaScript, or do you simply want to display the data in the KML inside the KMZ on a map? – Tony Miller Aug 19 '10 at 01:02
3 Answers
3
Well you need to see if it is possible to unzip the files. I would look at this stackoverflow post on using JavaScript. After that you will probably have a string of XML which you will need to convert to XML using the DOM parser.

Community
- 1
- 1

epascarello
- 204,599
- 20
- 195
- 236
2
You have to use geoxml3.js with ZipFile.complete.js available at KMZ
<script src="js/ZipFile.complete.js"></script>
<script src="js/geoxmlv3.js"></script>
var map = new google.maps.Map(document.getElementById(mapId), {
zoom: 11,center: {lat: 0,lng: 0}
});
var myParser = new geoXML3.parser({
map: map
});
myParser.parse(fileName);

Satheesh Valluru
- 58
- 3