本文整理匯總了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());
}