views:

1316

answers:

4

anyone knows a simple JS library implementing the UNZIP algorithm? No disk-file access, only zip and unzip a string of values. there are ActiveX, using WinZIP and other client dependent software for ZIP, written in JS.

but no pure algorithm implementation, is it really difficult or non-functional?

i would use it for displaying KMZ files in a HTML page with the GMap object (google maps). The KMZ file is just a zipped KML file. I want to unzip a KMZ file and feed the KML to GMap.

A: 

Perhaps ZipReader from Mozilla can be used for what you are after.

https://developer.mozilla.org/en/nsIZipReader

mr-euro
mr-euro
yes, you're right... some guys have some issues, tough http://groups.google.com/group/Google-Maps-API/browse_thread/thread/c0efb3a854563312
sopppas
but, the nslZipReader would only run on Mozilla's browser right?
sopppas
Yes ZipReader is only for Mozilla (Gecko browsers). But you could use ActiveX for IE and Zip Reader for the rest.Anyhow, regarding the eventual issues with KMZ try this alternative JS snippet. It should allow all elements of the KMZ file to be properly displayed: http://www.dcs.shef.ac.uk/~mark/blog/2008/11/easy-map-embedding_22.html
mr-euro
A: 

DotNetZip has a COM interface, that can be accessed from Javascript. It has a stream-to-stream unzip capability, but I have never tried using that from Javascript.
Also I have never tried using the library in any way from within IE.

Cheeso
+2  A: 

No need to unzip the KMZ file as Google Maps absolutely understands it. You can check it, simply search for the URL where your KMZ file is located in the Google Maps web interface and it will show its content on the map.

Here is a demo.

Török Gábor
A: 

kthoom implements unzip on a binary string: http://kthoom.googlecode.com/

codedread