本文整理汇总了C#中SharpMap.Map.GetCollection方法的典型用法代码示例。如果您正苦于以下问题:C# Map.GetCollection方法的具体用法?C# Map.GetCollection怎么用?C# Map.GetCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpMap.Map
的用法示例。
在下文中一共展示了Map.GetCollection方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map_TileAsyncAddedToDetachedCollection_DoesNotFireMapNewTileAvailable
public void Map_TileAsyncAddedToDetachedCollection_DoesNotFireMapNewTileAvailable(LayerCollectionType collectionType)
{
var map = new Map();
var group = CreateLayerGroup();
map.GetCollection(collectionType).Add(group);
var detachedCollection = group.Layers;
group.Layers = new ObservableCollection<ILayer>();
var tileAsync = CreateTileAsyncLayer();
detachedCollection.Add(tileAsync.Item1.Object);
var eventSource = map.GetMapNewTileAvailableAsObservable();
RaiseMapNewtileAvailableOn(tileAsync);
Assert.That(eventSource.Count().First(), Is.EqualTo(0), TestContext.CurrentContext.Test.GetDescription());
}
示例2: AddTileLayerToMap
private void AddTileLayerToMap(Tuple<Mock<ILayer>, Mock<ITileAsyncLayer>> tileLayer, Map map, LayerCollectionType collectionType = LayerCollectionType.Background)
{
var layer = tileLayer.Item1.Object;
map.GetCollection(collectionType).Add(layer);
}
示例3: Map_TileAsyncRemovedFromNephew_DoesNotFireMapNewtileAvailable
public void Map_TileAsyncRemovedFromNephew_DoesNotFireMapNewtileAvailable(LayerCollectionType collectionType)
{
var map = new Map();
var group = CreateLayerGroup();
map.GetCollection(collectionType).Add(group);
var subGroup = CreateLayerGroup("subgroup");
var tileAsyncLayer = CreateTileAsyncLayer();
AddTileLayerToLayerGroup(tileAsyncLayer, subGroup);
group.Layers.Add(subGroup);
// test
RemoveTileLayerFromGroup(subGroup, tileAsyncLayer);
var eventSource = map.GetMapNewTileAvailableAsObservable();
RaiseMapNewtileAvailableOn(tileAsyncLayer);
Assert.That(eventSource.Count().First(), Is.EqualTo(0), TestContext.CurrentContext.Test.GetDescription());
}
示例4: Map_TileAsyncAddedToReplacedCollection_FiresMapNewtileAvailable
public void Map_TileAsyncAddedToReplacedCollection_FiresMapNewtileAvailable(LayerCollectionType collectionType)
{
var map = new Map();
var group = CreateLayerGroup();
map.GetCollection(collectionType).Add(group);
group.Layers = new ObservableCollection<ILayer>();
var tileAsync = CreateTileAsyncLayer();
AddTileLayerToLayerGroup(tileAsync, group);
var eventSource = map.GetMapNewTileAvailableAsObservable();
RaiseMapNewtileAvailableOn(tileAsync);
Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
}
示例5: Map_TileAsyncFromClearedGroup_DoesNotFireMapNewTileAvailable
public void Map_TileAsyncFromClearedGroup_DoesNotFireMapNewTileAvailable(LayerCollectionType collectionType)
{
var map = new Map();
var group = CreateLayerGroup();
map.GetCollection(collectionType).Add(group);
var tileLayer = CreateTileAsyncLayer();
AddTileLayerToLayerGroup(tileLayer, group);
group.Layers.Clear();
var eventSource = map.GetMapNewTileAvailableAsObservable();
RaiseMapNewtileAvailableOn(tileLayer);
Assert.That(eventSource.IsEmpty().First(), TestContext.CurrentContext.Test.GetDescription());
}
示例6: Map_TileAsyncReplacedFromGroup_DoesNotFireMapNewTileAvailable
public void Map_TileAsyncReplacedFromGroup_DoesNotFireMapNewTileAvailable(LayerCollectionType collectionType)
{
var map = new Map();
var group = CreateLayerGroup();
map.GetCollection(collectionType).Add(group);
var tileLayer = CreateTileAsyncLayer();
AddTileLayerToLayerGroup(tileLayer, group);
var newTileLayer = CreateTileAsyncLayer();
ReplaceExistingAsyncLayerFromGroup(group, tileLayer, newTileLayer);
var eventSource = map.GetMapNewTileAvailableAsObservable();
RaiseMapNewtileAvailableOn(tileLayer);
Assert.That(eventSource.IsEmpty().First(),
"Map should NOT fire MapNewTileAvailable event for TileAsyncLayers replaced from a group");
RaiseMapNewtileAvailableOn(newTileLayer);
Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
}
示例7: MapDoesNoGenerateMapNewTile_AfterClear
public void MapDoesNoGenerateMapNewTile_AfterClear(LayerCollectionType collectionType)
{
var map = new Map();
var tileAsyncLayer = CreateTileAsyncLayer();
AddTileLayerToMap(tileAsyncLayer, map, collectionType);
var eventSource = map.GetMapNewTileAvailableAsObservable();
map.GetCollection(collectionType).Clear();
RaiseMapNewtileAvailableOn(tileAsyncLayer);
Assert.That(eventSource.IsEmpty().First(), TestContext.CurrentContext.Test.GetDescription());
}
示例8: MapGeneratesMapNewTile_NewReplacedLayers
public void MapGeneratesMapNewTile_NewReplacedLayers(LayerCollectionType collectionType)
{
var map = new Map();
var tileAsyncLayer = CreateTileAsyncLayer();
AddTileLayerToMap(tileAsyncLayer, map, collectionType);
var eventSource = map.GetMapNewTileAvailableAsObservable();
var newLayer = CreateTileAsyncLayer();
map.GetCollection(collectionType)[0] = newLayer.Item1.Object;
RaiseMapNewtileAvailableOn(newLayer);
Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
}
示例9: AfterRemovingTileAsyncLayer_MapDoesNotHookAnymoreItsMapNewTileAvailableEvent
public void AfterRemovingTileAsyncLayer_MapDoesNotHookAnymoreItsMapNewTileAvailableEvent(LayerCollectionType collectionType)
{
var map = new Map();
var tileAsyncLayer = CreateTileAsyncLayer();
AddTileLayerToMap(tileAsyncLayer, map, collectionType);
var eventSource = map.GetMapNewTileAvailableAsObservable();
map.GetCollection(collectionType).RemoveAt(0);
RaiseMapNewtileAvailableOn(tileAsyncLayer);
Assert.That(eventSource.Count().First(), Is.EqualTo(0), TestContext.CurrentContext.Test.GetDescription());
}