I have a .kmz file and want to display the data on a map.
If I unzip the file, and extract the .kml file and use that, I can get the map to display the data.
However, as the .kmz file is hosted somewhere else, I need to read that file and ideally wouldn't have to parse it locally each time it is updated.
My sample for parsing the .kml file is
var phase1 = new OpenLayers.Layer.Vector("phase1", {
projection: new OpenLayers.Projection("EPSG:4326"),
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "data.kml",
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true
})
})
});
Is there something in the above that needs changing to read the .kmz file?
I know Google Maps is able to use the .kmz file directly to display the data, but is it possible for OpenLayers to use the .kmz file directly? Or would it be necessary to parse the .kmz file someway to extract the .kml to display?