Search code examples
javascriptjquerysvgraphaelsvgz

How to decompress SVGZ with JavaScript?


I'm trying to set up this world map using SVGZ instead of SVG so I can give my users a richer, more detailed map.

So far I've tried decompressing it using js-deflate, but to no avail.


Solution

  • As I write in comment SVGZ uses gzip. Top browsers can decompress gzip files without assistance. Your page http://home.no/dwaynie/map load .svgz file with Content-Type:text/plain; charset=ISO-8859-1. But for SVG|SVGZ it's not valid MIME type.

    svg     Content-Type: image/svg+xml
    
    svgz    Content-Type: image/svg+xml
            Content-Encoding: gzip
    

    Above headers must be configured in web server (IIS, Apache).