private void setXml(string value)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(value);
XmlNode workspace = tryGetNodeByName(doc.ChildNodes, "map_workspace");
if (workspace != null)
{
_map = new Map();
processViewBox(workspace);
XmlNode map = tryGetNodeByName(workspace.ChildNodes, "map");
if (map != null)
{
_map.Title = map.Attributes["title"].Value;
_map.Description = map.Attributes["description"].Value;
if (map.Attributes["antialias"] != null)
_map.RenderingSettings.AntiAliasGeometry = map.Attributes["antialias"].Value == "1";
if (map.Attributes["text_antialias"] != null)
_map.RenderingSettings.AntiAliasText = map.Attributes["text_antialias"].Value == "1";
if (map.Attributes["coordinate_system_wkt"] != null)
_map.CoodrinateSystemWKT = map.Attributes["coordinate_system_wkt"].Value;
processRaster(map);
XmlNode appData = tryGetNodeByName(map.ChildNodes, "application_data");
if (appData != null)
_map.ApplicationXmlData = appData.InnerXml;
XmlNode layers = tryGetNodeByName(map.ChildNodes, "layers");
if (layers != null)
{
foreach (XmlNode n in layers.ChildNodes)
if (n.Name == "layer")
processLayer(n);
}
}
}
else
throw new FormatException("Invalid workspace format");
}