Exemple #1
0
 public Map(string name, string url, MapVersion version, MapAuthor author, MapArguments arg, ILayer[] layers)
     : this(name, url, version, author, arg)
 {
     _inputLayers          = layers;
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Exemple #2
0
 public Map()
 {
     _version              = new MapVersion();
     _author               = new MapAuthor();
     _arguments            = new MapArguments();
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Exemple #3
0
 public Map(string name, string url)
 {
     _name                 = name;
     _url                  = url;
     _version              = new MapVersion();
     _author               = new MapAuthor();
     _arguments            = new MapArguments();
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Exemple #4
0
        private static MapArguments GetMapArguments(XDocument doc)
        {
            var result = doc.Element("Map").Element("MapArguments");

            if (result == null)
            {
                return(null);
            }
            return(MapArguments.FromXElement(result as XElement));
        }
Exemple #5
0
 public Map(string name, string url, MapVersion version, MapAuthor author, MapArguments arg)
 {
     _name    = name;
     _url     = url;
     _version = version;
     _author  = author;
     if (arg == null)
     {
         arg = new MapArguments();
     }
     _arguments            = arg;
     _conflictDefForSymbol = new ConflictDefinition();
     _conflictDefForLabel  = new ConflictDefinition(new Size(60, 16), true);
 }
Exemple #6
0
        public static MapArguments FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            MapArguments arg = new MapArguments();

            arg.BackColor = ColorHelper.StringToColor(ele.Attribute("backcolor").Value);
            if (ele.Element("FullExtent") != null)
            {
                arg.FullExtent = XElementToEnvelope(ele.Element("FullExtent"));
            }
            if (ele.Element("Extent") != null)
            {
                arg.Extent = XElementToEnvelope(ele.Element("Extent"));
            }
            if (ele.Attribute("smoothingmode") != null)
            {
                string        sm    = ele.Attribute("smoothingmode").Value;
                SmoothingMode smode = SmoothingMode.Default;
                foreach (SmoothingMode s in Enum.GetValues(typeof(SmoothingMode)))
                {
                    if (s.ToString() == sm)
                    {
                        smode = s;
                        break;
                    }
                }
                arg.SmoothingMode = smode;
            }
            if (ele.Attribute("spatialreference") != null)
            {
                try
                {
                    string sf = ele.Attribute("spatialreference").Value;
                    arg._targetSpatialReference = SpatialReferenceFactory.GetSpatialReferenceByWKT(sf, enumWKTSource.EsriPrjFile);
                }
                catch (Exception ex)
                {
                    Log.WriterException(ex);
                }
            }
            return(arg);
        }
Exemple #7
0
 private static IMap ParseMapFromXml(string filename)
 {
     PersistObject.BeginParse();
     try
     {
         XDocument          doc = XDocument.Load(filename);
         MapAuthor          author = GetMapAuthor(doc);
         MapVersion         version = GetMapVersion(doc);
         MapArguments       arg = GetMapArguments(doc);
         ConflictDefinition csym = null, clabel = null;
         GetConflictDef(doc, out csym, out clabel);
         ILayer[] layers  = GetFeatureLayer(doc);
         string   mapname = doc.Element("Map").Attribute("name").Value;
         Map      map = new Map(mapname, filename, version, author, arg, layers);
         map.SetConflictDefinition(csym, clabel);
         return(map);
     }
     finally
     {
         PersistObject.EndParse();
     }
 }