用XSLT把GML转SVG然后压缩,发布一个矢量的map
作者: 赵博 • 2006 年 1 月 22 日 • 技术主义 • 3 条评论
写的一个demo,3.8M的Provinces.gml(仅空间数据)发布成压缩过的SVG后327K。
这是load4.htm的代码
这是line.aspx的C#代码,需要ZIPLIB
this.Response.ContentType = “image/svg+xml”;
XslTransform xslt = new XslTransform();
xslt.Load(Server.MapPath(“Region.xsl”));
XPathDocument xpathdocument = new XPathDocument(Server.MapPath(“chinese.gml”));
GZipOutputStream CompressedOutput = new GZipOutputStream(Response.OutputStream, 100);
XmlTextWriter writer = new XmlTextWriter(CompressedOutput, Encoding.UTF8);
writer.Formatting=Formatting.Indented;
xslt.Transform(xpathdocument, null, writer, null);
CompressedOutput.Finish();
下面是截图,弹的的数字的当前的viewbox。(少了几个省是因为XSLT还没写完)
相关文章:

打不开您的SVG
hehe
hh