I have been very busy and busy. I have no time to write something .........
A demo written before 51. The Provinces. gml (only space data) of 3.8M is released into the compressed SVG and then 327 kb.
This is the load4.htm Code <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> untitled document </title>
<Script>
Var svgEmb = null;
Var svgDoc = null;
Function init ()
{
SvgEmb = document. embeds ["SVG1"];
// Alert (svgEmb );
SvgDoc = svgEmb. getSVGDocument ();
SvgEmb. window. getURL ("line. aspx", loadSVG, "text/xml ");
}
Function loadSVG (templeContent)
{
If (templeContent. success)
{
Var domResponse = svgEmb. window. parseXML (templeContent. content );
Var frag = svgEmb. window. parseXML (svgEmb. window. printNode (domResponse. getElementsByTagName ("svg"). item (0), svgDoc );
// Frag. firstChild. setAttribute ("transform", "scale (1,-1 )");
SvgDoc. replaceChild (frag. firstChild, svgDoc. rootElement );
// SvgDoc. rootElement. appendChild (frag. firstChild );
SvgDoc. getElementById ("omVectorLayer"). setAttribute ("transform", "scale (1,-1 )");
Var svgRect = svgDoc. rootElement. getBBox ();
// Var svgRect = svgDoc. getElementById ("omVectorLayer"). getBBox ();
Var strViewBox = svgRect. x + "" + svgRect. y + "+ svgRect. width +" + svgRect. height;
// Alert (svgRect. x );
SvgDoc. rootElement. setAttribute ("viewBox", strViewBox );
}
}
Function getSvg ()
{
// Var oPop = window. open ();
// OPop.doc ument. body. innerText = svgEmb. window. printNode (svgDoc );
Alert (svgEmb. window. printNode (svgDoc ));
// SvgDoc. rootElement. setAttribute ("transform", "scale (1,-1 )");
}
Function getViewBox ()
{
Alert (svgDoc. rootElement. getAttribute ("viewBox "));
}
</Script>
</Head>
<Body onLoad = "init ()" bgcolor = "#666600" background = "background.jpg">
<Embed id = "SVG1" width = "500" height = "500" src = "test. svg"> </embed>
<Input value = "getsvg" type = "button" onClick = "getSvg ()">
<Input value = "getviewbox" type = "button" onClick = "getViewBox ()">
</Body>
</Html>
This is the line. aspx C # code, which requires ZIPLIB
This. Response. ContentType = "image/svg + xml ";
Transform transform xslt = new transform ();
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 ();
The following figure shows the current viewbox of the number. (A few provinces are missing because XSLT has not been written)