質問

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.

役に立ちましたか?

解決

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).

他のヒント

If you want the SVG file inside of the SVGZ, you gunzip it (it's a renamed archive):

cp file.svgz file2.svg.gz
gunzip file2.svg.gz

If you want to use a SVGZ image, then you might run into trouble. I think some browsers support it (virtually all support Gzip compression), but I doubt many do (if any at all).

Just below the map on the page you refer to there's a link to Wikipedia that explains what it is: an SVG file compressed with gzip.

For completeness sake: gzip and (pk)zip are not the same format, but Windows tools like WinRAR and 7-Zip understand gzip as well as zip. Every Linux distro probably has gzip/gunzip installed by default.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top