Esempio n. 1
0
        /// <summary>
        /// Gets whether a base layer of the specified name exists.
        /// </summary>
        /// <param name="map">The map</param>
        /// <param name="layerName">The layer name</param>
        /// <returns>True if it exists. False otherwise</returns>
        public static bool LayerExists(this ITileSetAbstract map, string layerName)
        {
            Check.ArgumentNotNull(map, nameof(map));
            Check.ArgumentNotEmpty(layerName, nameof(layerName));

            return(map.GetBaseLayerByName(layerName) != null);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the maximum finite display scale
        /// </summary>
        /// <param name="map">The map</param>
        /// <returns>The maximum scale</returns>
        public static double GetMaxScale(this ITileSetAbstract map)
        {
            Check.ArgumentNotNull(map, nameof(map));
            if (map.ScaleCount == 0)
            {
                return(0.0);
            }

            return(map.FiniteDisplayScale.Last());
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the first base map group
        /// </summary>
        /// <param name="map">The map</param>
        /// <returns>The first base map group</returns>
        public static IBaseMapGroup GetFirstGroup(this ITileSetAbstract map)
        {
            Check.ArgumentNotNull(map, nameof(map));
            var list = new List <IBaseMapGroup>(map.BaseMapLayerGroups);

            if (list.Count > 0)
            {
                return(list[0]);
            }
            return(null);
        }
Esempio n. 4
0
 /// <summary>
 /// Gets the base map group of the specified name
 /// </summary>
 /// <param name="map">The map</param>
 /// <param name="groupName">The group name</param>
 /// <returns>The base map group</returns>
 public static IBaseMapGroup GetGroup(this ITileSetAbstract map, string groupName)
 {
     Check.ArgumentNotNull(map, nameof(map));
     Check.ArgumentNotEmpty(groupName, nameof(groupName));
     foreach (var group in map.BaseMapLayerGroups)
     {
         if (groupName.Equals(group.Name))
         {
             return(group);
         }
     }
     return(null);
 }
Esempio n. 5
0
 /// <summary>
 /// Gets whether the specified base map group exists
 /// </summary>
 /// <param name="map">The map</param>
 /// <param name="groupName">The group name</param>
 /// <returns>True if it exists. False otherwise</returns>
 public static bool GroupExists(this ITileSetAbstract map, string groupName)
 {
     Check.ArgumentNotNull(map, nameof(map));
     Check.ArgumentNotEmpty(groupName, nameof(groupName));
     foreach (var group in map.BaseMapLayerGroups)
     {
         if (groupName.Equals(group.Name))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 6
0
        /// <summary>
        /// Gets the tiled layers for the specified base map group
        /// </summary>
        /// <param name="map">The map</param>
        /// <param name="groupName">The group name</param>
        /// <returns>The tiled layers</returns>
        public static IEnumerable <IBaseMapLayer> GetLayersForGroup(this ITileSetAbstract map, string groupName)
        {
            Check.ArgumentNotNull(map, nameof(map));
            Check.ArgumentNotEmpty(groupName, nameof(groupName));

            foreach (var group in map.BaseMapLayerGroups)
            {
                if (groupName.Equals(group.Name))
                {
                    return(group.BaseMapLayer);
                }
            }

            return(new IBaseMapLayer[0]);
        }
Esempio n. 7
0
 /// <summary>
 /// Gets the parent group for the specified layer
 /// </summary>
 /// <param name="map">The map</param>
 /// <param name="layer">The layer</param>
 /// <returns>The parent group</returns>
 public static IBaseMapGroup GetGroupForLayer(this ITileSetAbstract map, IBaseMapLayer layer)
 {
     Check.ArgumentNotNull(map, nameof(map));
     foreach (var group in map.BaseMapLayerGroups)
     {
         foreach (var tl in group.BaseMapLayer)
         {
             if (tl == layer)
             {
                 return(group);
             }
         }
     }
     return(null);
 }
Esempio n. 8
0
 public FiniteScaleListCtrl(ITileSetAbstract map, IEditorService editorSvc)
     : this()
 {
     _tileSet = map;
     _edSvc   = editorSvc;
     //Init scale list
     if (_tileSet != null)
     {
         foreach (var scale in _tileSet.FiniteDisplayScale)
         {
             _scales.Add(scale);
         }
     }
     //Now wire change events
     _scales.ListChanged += new ListChangedEventHandler(OnScaleListChanged);
 }
Esempio n. 9
0
        /// <summary>
        /// Gets the base layer of the specified name
        /// </summary>
        /// <param name="map">The map</param>
        /// <param name="layerName">The layer name</param>
        /// <returns>The base layer</returns>
        public static IBaseMapLayer GetBaseLayerByName(this ITileSetAbstract map, string layerName)
        {
            Check.ArgumentNotNull(map, nameof(map));
            Check.ArgumentNotEmpty(layerName, nameof(layerName));

            foreach (var group in map.BaseMapLayerGroups)
            {
                foreach (var layer in group.BaseMapLayer)
                {
                    if (layerName.Equals(layer.Name))
                    {
                        return(layer);
                    }
                }
            }
            return(null);
        }
Esempio n. 10
0
        /// <summary>
        /// Gets whether this base map has tiled layers
        /// </summary>
        /// <param name="map">The map</param>
        /// <returns>True if it has tiled layers. False otherwise</returns>
        public static bool HasLayers(this ITileSetAbstract map)
        {
            Check.ArgumentNotNull(map, nameof(map));
            if (!map.HasGroups())
            {
                return(false);
            }

            foreach (var group in map.BaseMapLayerGroups)
            {
                if (group.HasLayers())
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 11
0
        public FiniteScaleListCtrl(IMapDefinition parent, IEditorService editorSvc)
            : this()
        {
            _parent = parent;
            _parent.InitBaseMap();

            _tileSet = _parent.BaseMap;
            _edSvc   = editorSvc;
            //Init scale list
            if (_tileSet != null)
            {
                foreach (var scale in _tileSet.FiniteDisplayScale)
                {
                    _scales.Add(scale);
                }
            }
            //Now wire change events
            _scales.ListChanged += new ListChangedEventHandler(OnScaleListChanged);
        }
        public void TestUnsupportedScaleOperations()
        {
            var tsd = ObjectFactory.CreateTileSetDefinition(new Version(3, 0, 0));

            tsd.SetXYZProviderParameters();

            ITileSetAbstract tsTileSet = tsd;

            Assert.False(tsTileSet.SupportsCustomFiniteDisplayScalesUnconditionally);
            Assert.False(tsTileSet.SupportsCustomFiniteDisplayScales);

            Assert.Throws <InvalidOperationException>(() => tsTileSet.SetFiniteDisplayScales(new double[] { 1.0, 2.0, 4.0 }));
            Assert.Throws <InvalidOperationException>(() => { var x = tsTileSet.ScaleCount; });
            Assert.Throws <InvalidOperationException>(() => tsTileSet.SetFiniteDisplayScales(new double[] { 1.0, 2.0, 4.0, 8.0, 16.0 }));
            Assert.Throws <InvalidOperationException>(() => tsTileSet.GetScaleAt(0));
            Assert.Throws <InvalidOperationException>(() => tsTileSet.RemoveScaleAt(3));
            Assert.Throws <InvalidOperationException>(() => tsTileSet.RemoveFiniteDisplayScale(1.2));
            Assert.Throws <InvalidOperationException>(() => tsTileSet.RemoveAllScales());
            Assert.Throws <InvalidOperationException>(() => tsTileSet.AddFiniteDisplayScale(1234.0));
        }
        /// <summary>
        /// Constructs a new map to be processed
        /// </summary>
        /// <param name="parent">The parent entry</param>
        /// <param name="map">The resource id for the mapdefinition</param>
        public MapTilingConfiguration(TilingRunCollection parent, string map)
        {
            m_parent = parent;

            IResource          res = parent.Connection.ResourceService.GetResource(map);
            IMapDefinition     mdf = res as IMapDefinition;
            ITileSetDefinition tsd = res as ITileSetDefinition;

            if (mdf != null)
            {
                m_tileSetResourceID = mdf.ResourceID;
                m_tileSetExtents    = mdf.Extents.Clone();
                m_tileset           = mdf.BaseMap;
            }
            else if (tsd != null && tsd.SupportsCustomFiniteDisplayScales)
            {
                m_tileSetResourceID = tsd.ResourceID;
                m_tileSetExtents    = tsd.Extents.Clone();
                m_tileset           = tsd;
            }

            if (m_tileset == null)
            {
                throw new InvalidOperationException(OSGeo.MapGuide.MaestroAPI.Strings.UnseedableTileSet);
            }

            var baseMap = m_tileset;

            if (baseMap != null &&
                baseMap.ScaleCount > 0)
            {
                m_groups = new string[baseMap.GroupCount];
                for (int i = 0; i < baseMap.GroupCount; i++)
                {
                    m_groups[i] = baseMap.GetGroupAt(i).Name;
                }

                m_maxscale = baseMap.GetMaxScale();
                CalculateDimensions();
            }
        }
Esempio n. 14
0
 public TiledLayerModel(ITileSetAbstract tileSet)
 {
     _tileSet = tileSet;
 }
Esempio n. 15
0
 internal void Invalidate(ITileSetAbstract tileSet)
 {
     _tileSet = tileSet;
     base.Invalidate();
 }
Esempio n. 16
0
        public SetupRun(IServerConnection connection, string[] maps, IDictionary <string, string> args)
            : this()
        {
            m_connection = connection;

            m_commandlineargs     = args;
            m_coordinateOverrides = new Dictionary <string, IEnvelope>();
            IEnvelope overrideExtents = null;

            if (m_commandlineargs.ContainsKey(TileRunParameters.MAPDEFINITIONS)) //NOXLATE
            {
                m_commandlineargs.Remove(TileRunParameters.MAPDEFINITIONS);      //NOXLATE
            }
            if (m_commandlineargs.ContainsKey(TileRunParameters.PROVIDER) && m_commandlineargs.ContainsKey(TileRunParameters.CONNECTIONPARAMS))
            {
                txtProvider.Text         = m_commandlineargs[TileRunParameters.PROVIDER];
                txtConnectionString.Text = m_commandlineargs[TileRunParameters.CONNECTIONPARAMS];
            }
            else
            {
                txtProvider.Text         = connection.ProviderName;
                txtConnectionString.Text = Utility.ToConnectionString(connection.CloneParameters);
            }
            if (m_commandlineargs.ContainsKey(TileRunParameters.LIMITROWS)) //NOXLATE
            {
                int i;
                if (int.TryParse(m_commandlineargs[TileRunParameters.LIMITROWS], out i) && i > 0) //NOXLATE
                {
                    MaxRowLimit.Value         = i;
                    TilesetLimitPanel.Enabled = true;
                }
            }

            if (m_commandlineargs.ContainsKey(TileRunParameters.LIMITCOLS)) //NOXLATE
            {
                int i;
                if (int.TryParse(m_commandlineargs[TileRunParameters.LIMITCOLS], out i) && i > 0) //NOXLATE
                {
                    MaxColLimit.Value         = i;
                    TilesetLimitPanel.Enabled = true;
                }
            }

            if (m_commandlineargs.ContainsKey(TileRunParameters.EXTENTOVERRIDE)) //NOXLATE
            {
                string[] parts = m_commandlineargs[TileRunParameters.EXTENTOVERRIDE].Split(',');
                if (parts.Length == 4)
                {
                    double minx;
                    double miny;
                    double maxx;
                    double maxy;
                    if (
                        double.TryParse(parts[0], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out minx) &&
                        double.TryParse(parts[1], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out miny) &&
                        double.TryParse(parts[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out maxx) &&
                        double.TryParse(parts[3], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out maxy)
                        )
                    {
                        overrideExtents = ObjectFactory.CreateEnvelope(minx, miny, maxx, maxy);
                    }
                }
            }

            if (m_commandlineargs.ContainsKey(TileRunParameters.METERSPERUNIT)) //NOXLATE
            {
                double d;
                if (
                    double.TryParse(m_commandlineargs[TileRunParameters.METERSPERUNIT], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentUICulture, out d) || //NOXLATE
                    double.TryParse(m_commandlineargs[TileRunParameters.METERSPERUNIT], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d)    //NOXLATE
                    )
                {
                    if (d >= (double)MetersPerUnit.Minimum && d <= (double)MetersPerUnit.Maximum)
                    {
                        MetersPerUnit.Value = (decimal)d;
                    }
                }
            }

            if (maps == null || maps.Length == 0 || (maps.Length == 1 && maps[0].Trim().Length == 0))
            {
                List <string> tmp = new List <string>();
                foreach (ResourceListResourceDocument doc in m_connection.ResourceService.GetRepositoryResources(StringConstants.RootIdentifier, ResourceTypes.MapDefinition.ToString()).Items)
                {
                    tmp.Add(doc.ResourceId);
                }
                foreach (ResourceListResourceDocument doc in m_connection.ResourceService.GetRepositoryResources(StringConstants.RootIdentifier, ResourceTypes.TileSetDefinition.ToString()).Items)
                {
                    tmp.Add(doc.ResourceId);
                }
                maps = tmp.ToArray();
            }

            var basegroupsSelected = new List <string>();

            if (m_commandlineargs.ContainsKey(TileRunParameters.BASEGROUPS))                                        //NOXLATE
            {
                basegroupsSelected = new List <string>(m_commandlineargs[TileRunParameters.BASEGROUPS].Split(',')); //NOXLATE
                m_commandlineargs.Remove(TileRunParameters.BASEGROUPS);                                             //NOXLATE
            }

            var scalesSelected = new List <int>();

            if (m_commandlineargs.ContainsKey(TileRunParameters.SCALEINDEX))                              //NOXLATE
            {
                foreach (string scaleIndex in m_commandlineargs[TileRunParameters.SCALEINDEX].Split(',')) //NOXLATE
                {
                    scalesSelected.Add(int.Parse(scaleIndex));
                }
                m_commandlineargs.Remove(TileRunParameters.SCALEINDEX); //NOXLATE
            }

            MapTree.Nodes.Clear();
            foreach (string m in maps)
            {
                ITileSetAbstract   tileSet = null;
                IResource          res     = m_connection.ResourceService.GetResource(m);
                IMapDefinition     mdef    = res as IMapDefinition;
                ITileSetDefinition tsd     = res as ITileSetDefinition;
                if (mdef != null)
                {
                    tileSet = mdef.BaseMap;
                }
                else if (tsd != null && tsd.SupportsCustomFiniteDisplayScales)
                {
                    tileSet = tsd;
                }

                if (tileSet == null)
                {
                    continue;
                }

                bool bValidTileSet = (tileSet != null &&
                                      tileSet.ScaleCount > 0 &&
                                      tileSet.HasGroups());

                if (bValidTileSet)
                {
                    TreeNode mn = MapTree.Nodes.Add(m);

                    mn.ImageIndex = mn.SelectedImageIndex = 0;
                    mn.Tag        = (object)mdef ?? (object)tsd;
                    foreach (var g in tileSet.BaseMapLayerGroups)
                    {
                        TreeNode gn = mn.Nodes.Add(g.Name);
                        gn.Tag = g;
                        if (basegroupsSelected.Contains(g.Name))
                        {
                            mn.Checked = true;
                            gn.Checked = true;
                            if (overrideExtents != null && !m_coordinateOverrides.ContainsKey(m))
                            {
                                m_coordinateOverrides.Add(m, overrideExtents);
                            }
                        }

                        gn.ImageIndex = gn.SelectedImageIndex = 1;

                        int counter = 0;
                        foreach (double d in tileSet.FiniteDisplayScale)
                        {
                            TreeNode sn = gn.Nodes.Add(d.ToString(System.Globalization.CultureInfo.CurrentUICulture));
                            if (gn.Checked && scalesSelected.Contains(counter))
                            {
                                sn.Checked = true;
                            }
                            sn.ImageIndex = sn.SelectedImageIndex = 3;
                            counter++;
                        }
                    }

                    mn.Expand();
                }
            }
            MapTree_AfterSelect(null, null);
        }
Esempio n. 17
0
 /// <summary>
 /// Gets whether this base map has groups
 /// </summary>
 /// <param name="map">The map</param>
 /// <returns>True if it has groups. False otherwise</returns>
 public static bool HasGroups(this ITileSetAbstract map)
 {
     Check.ArgumentNotNull(map, nameof(map));
     return(new List <IBaseMapGroup>(map.BaseMapLayerGroups).Count > 0);
 }
Esempio n. 18
0
 /// <summary>
 /// Gets the number of base layers
 /// </summary>
 /// <param name="map">The map</param>
 /// <returns>The count</returns>
 public static int GetBaseLayerCount(this ITileSetAbstract map)
 {
     Check.ArgumentNotNull(map, nameof(map));
     return(map.BaseMapLayerGroups.SelectMany(g => g.BaseMapLayer).Count());
 }
        public void FiniteScalesTest()
        {
            var mdf = ObjectFactory.CreateMapDefinition(new Version(3, 0, 0), "Test");
            var tsd = ObjectFactory.CreateTileSetDefinition(new Version(3, 0, 0));

            mdf.InitBaseMap();
            tsd.SetDefaultProviderParameters(300, 300, "", new double[] { });

            ITileSetAbstract tsMapDef  = mdf.BaseMap;
            ITileSetAbstract tsTileSet = tsd;

            Assert.False(tsTileSet.SupportsCustomFiniteDisplayScalesUnconditionally);
            Assert.True(tsTileSet.SupportsCustomFiniteDisplayScales);

            tsMapDef.SetFiniteDisplayScales(new double[] { 1.0, 2.0, 4.0 });
            tsTileSet.SetFiniteDisplayScales(new double[] { 1.0, 2.0, 4.0 });

            Assert.Equal(3, tsMapDef.ScaleCount);
            Assert.Equal(3, tsTileSet.ScaleCount);

            tsMapDef.SetFiniteDisplayScales(new double[] { 1.0, 2.0, 4.0, 8.0, 16.0 });
            tsTileSet.SetFiniteDisplayScales(new double[] { 1.0, 2.0, 4.0, 8.0, 16.0 });

            Assert.Equal(5, tsMapDef.ScaleCount);
            Assert.Equal(5, tsTileSet.ScaleCount);

            Assert.Equal(1.0, tsMapDef.GetScaleAt(0));
            Assert.Equal(1.0, tsTileSet.GetScaleAt(0));

            Assert.Equal(2.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(2.0, tsTileSet.GetScaleAt(1));

            Assert.Equal(4.0, tsMapDef.GetScaleAt(2));
            Assert.Equal(4.0, tsTileSet.GetScaleAt(2));

            Assert.Equal(8.0, tsMapDef.GetScaleAt(3));
            Assert.Equal(8.0, tsTileSet.GetScaleAt(3));

            Assert.Equal(16.0, tsMapDef.GetScaleAt(4));
            Assert.Equal(16.0, tsTileSet.GetScaleAt(4));

            tsMapDef.RemoveScaleAt(3);
            tsTileSet.RemoveScaleAt(3);

            Assert.Equal(1.0, tsMapDef.GetScaleAt(0));
            Assert.Equal(1.0, tsTileSet.GetScaleAt(0));

            Assert.Equal(2.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(2.0, tsTileSet.GetScaleAt(1));

            Assert.Equal(4.0, tsMapDef.GetScaleAt(2));
            Assert.Equal(4.0, tsTileSet.GetScaleAt(2));

            Assert.Equal(16.0, tsMapDef.GetScaleAt(3));
            Assert.Equal(16.0, tsTileSet.GetScaleAt(3));

            tsMapDef.RemoveScaleAt(0);
            tsTileSet.RemoveScaleAt(0);

            Assert.Equal(2.0, tsMapDef.GetScaleAt(0));
            Assert.Equal(2.0, tsTileSet.GetScaleAt(0));

            Assert.Equal(4.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(4.0, tsTileSet.GetScaleAt(1));

            Assert.Equal(16.0, tsMapDef.GetScaleAt(2));
            Assert.Equal(16.0, tsTileSet.GetScaleAt(2));

            tsMapDef.RemoveScaleAt(2);
            tsTileSet.RemoveScaleAt(2);

            Assert.Equal(2.0, tsMapDef.GetScaleAt(0));
            Assert.Equal(2.0, tsTileSet.GetScaleAt(0));

            Assert.Equal(4.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(4.0, tsTileSet.GetScaleAt(1));

            Assert.Equal(2.0, tsMapDef.GetMinScale());
            Assert.Equal(2.0, tsTileSet.GetMinScale());

            tsMapDef.RemoveFiniteDisplayScale(1.2);
            tsTileSet.RemoveFiniteDisplayScale(1.2);

            Assert.Equal(2.0, tsMapDef.GetScaleAt(0));
            Assert.Equal(2.0, tsTileSet.GetScaleAt(0));

            Assert.Equal(4.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(4.0, tsTileSet.GetScaleAt(1));

            Assert.Throws <ArgumentOutOfRangeException>(() => tsMapDef.RemoveScaleAt(6));
            Assert.Throws <ArgumentOutOfRangeException>(() => tsTileSet.RemoveScaleAt(6));

            Assert.Equal(2.0, tsMapDef.GetScaleAt(0));
            Assert.Equal(2.0, tsTileSet.GetScaleAt(0));

            Assert.Equal(4.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(4.0, tsTileSet.GetScaleAt(1));

            tsMapDef.AddFiniteDisplayScale(3.0);
            tsTileSet.AddFiniteDisplayScale(3.0);

            Assert.Equal(3, tsMapDef.ScaleCount);
            Assert.Equal(3, tsTileSet.ScaleCount);

            Assert.Equal(3.0, tsMapDef.GetScaleAt(1));
            Assert.Equal(3.0, tsTileSet.GetScaleAt(1));

            tsMapDef.RemoveAllScales();
            tsTileSet.RemoveAllScales();

            Assert.Equal(0, tsMapDef.ScaleCount);
            Assert.Equal(0, tsTileSet.ScaleCount);
        }
        public void GroupManagementTest()
        {
            var mdf = ObjectFactory.CreateMapDefinition(new Version(3, 0, 0), "Test");
            var tsd = ObjectFactory.CreateTileSetDefinition(new Version(3, 0, 0));

            mdf.InitBaseMap();
            tsd.SetDefaultProviderParameters(300, 300, "", new double[] { });

            ITileSetAbstract tsMapDef  = mdf.BaseMap;
            ITileSetAbstract tsTileSet = tsd;

            //Default tile set has a base group (to satisfy minimum content model), so clear that first
            tsTileSet.RemoveBaseLayerGroup(tsTileSet.BaseMapLayerGroups.First());

            Assert.Equal(0, tsMapDef.GroupCount);
            Assert.Equal(0, tsTileSet.GroupCount);

            var grpMapDef  = tsMapDef.AddBaseLayerGroup("Test");
            var grpTileSet = tsTileSet.AddBaseLayerGroup("Test");

            Assert.NotNull(grpMapDef);
            Assert.NotNull(grpTileSet);
            Assert.Equal("Test", grpMapDef.Name);
            Assert.Equal("Test", grpTileSet.Name);
            Assert.Equal(1, tsMapDef.GroupCount);
            Assert.Equal(1, tsTileSet.GroupCount);

            Assert.NotNull(grpMapDef.AddLayer("layer1", "Library://test/layer1.LayerDefinition"));
            Assert.NotNull(grpMapDef.AddLayer("layer2", "Library://test/layer2.LayerDefinition"));
            Assert.NotNull(grpTileSet.AddLayer("layer1", "Library://test/layer1.LayerDefinition"));
            Assert.NotNull(grpTileSet.AddLayer("layer2", "Library://test/layer2.LayerDefinition"));

            grpMapDef  = tsMapDef.AddBaseLayerGroup("Test2");
            grpTileSet = tsTileSet.AddBaseLayerGroup("Test2");
            Assert.NotNull(grpMapDef);
            Assert.NotNull(grpTileSet);
            Assert.Equal("Test2", grpMapDef.Name);
            Assert.Equal("Test2", grpTileSet.Name);
            Assert.Equal(2, tsMapDef.GroupCount);
            Assert.Equal(2, tsTileSet.GroupCount);

            Assert.NotNull(grpMapDef.AddLayer("layer3", "Library://test/layer3.LayerDefinition"));
            Assert.NotNull(grpTileSet.AddLayer("layer3", "Library://test/layer3.LayerDefinition"));

            Assert.Equal(3, tsMapDef.GetBaseLayerCount());
            Assert.Equal(3, tsTileSet.GetBaseLayerCount());

            Assert.NotNull(tsMapDef.GetBaseLayerByName("layer1"));
            Assert.NotNull(tsMapDef.GetBaseLayerByName("layer2"));
            Assert.NotNull(tsMapDef.GetBaseLayerByName("layer3"));

            Assert.NotNull(tsTileSet.GetBaseLayerByName("layer1"));
            Assert.NotNull(tsTileSet.GetBaseLayerByName("layer2"));
            Assert.NotNull(tsTileSet.GetBaseLayerByName("layer3"));

            tsMapDef.RemoveBaseLayerGroup(tsMapDef.GetGroup("Test"));
            tsTileSet.RemoveBaseLayerGroup(tsTileSet.GetGroup("Test"));

            Assert.Null(tsMapDef.GetBaseLayerByName("layer1"));
            Assert.Null(tsMapDef.GetBaseLayerByName("layer2"));
            Assert.NotNull(tsMapDef.GetBaseLayerByName("layer3"));

            Assert.Null(tsTileSet.GetBaseLayerByName("layer1"));
            Assert.Null(tsTileSet.GetBaseLayerByName("layer2"));
            Assert.NotNull(tsTileSet.GetBaseLayerByName("layer3"));

            Assert.Equal(1, tsMapDef.GetBaseLayerCount());
            Assert.Equal(1, tsTileSet.GetBaseLayerCount());
        }