Example #1
0
        public void TestClone()
        {
            Map map = new Map(new Size(2, 1));
            map.Layers.Add(new VectorLayer("Layer 1"));
            map.Layers.Add(new VectorLayer("Layer 3"));
            map.Layers.Add(new VectorLayer("Layer 2"));
            map.Layers.Add(new VectorLayer("Layer 4"));

            var clone = map.Clone();

            Assert.AreEqual(map.BackgroundLayer.Count, clone.BackgroundLayer.Count);
            Assert.AreEqual(map.Layers.Count, clone.Layers.Count);
            Assert.AreEqual(map.VariableLayers.Count, clone.VariableLayers.Count);
            Assert.AreEqual(map.Decorations.Count, clone.Decorations.Count);
        }
Example #2
0
        public CreateTilesSample(Map map, bool transformToMercator, string rootTilesPath)
        {
            _map = map.Clone();
            
            _map.MaximumZoom = double.MaxValue;
            _map.MinimumZoom = 0;

            if (transformToMercator)
            {
                TransformLayers(LayerTools.Wgs84toGoogleMercator);
            }

            _rootTilesPath = rootTilesPath;
            if (!Directory.Exists(_rootTilesPath))
            {
                Directory.CreateDirectory(_rootTilesPath);
            }
        }
Example #3
0
        public void Clone_ShoulCloneTheGroups()
        {
            // LayerGroups must be cloned because we want that each instance of the map listens to only the notification events of its children.

            var map = new Map();

            var group = CreateLayerGroup();

            map.Layers.Add(group);

            var clonedMap = map.Clone();

            Assert.That(clonedMap.Layers[0], Is.Not.EqualTo(group), TestContext.CurrentContext.Test.GetDescription());
        }