本文整理匯總了C#中SharpMap.Map.Clone方法的典型用法代碼示例。如果您正苦於以下問題:C# Map.Clone方法的具體用法?C# Map.Clone怎麽用?C# Map.Clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpMap.Map
的用法示例。
在下文中一共展示了Map.Clone方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestClone
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);
}
示例2: CreateTilesSample
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);
}
}
示例3: Clone_ShoulCloneTheGroups
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());
}