DotSpatial Library : MapWindow Discussion Forum
Hi! I am looping legend for layers and groups inside mwToolStrip.cs and want to remove specific group or specific layer. Here is my code: foreach (ILayer layer in _basicMap.MapFrame) { IGro
mwToolStrip.cs
Posted by:
vzavec ()
Date: September 28, 2010 09:56AM
Hi!
I am looping legend for layers and groups inside mwToolStrip.cs and want to remove specific group or specific layer.
Here is my code:
foreach (ILayer layer in _basicMap.MapFrame)
{
IGroup grp = layer as IGroup;
if (grp != null)
{
if (grp.LegendText == "KARTE")
{
// THIS SENTENCE IS NOT WORKING ???
grp.Remove(layer);
//geoMap1.Refresh();
//legend1.RefreshNodes();
}
}
}
Thanks for any help, Vojko
I am looping legend for layers and groups inside mwToolStrip.cs and want to remove specific group or specific layer.
Here is my code:
foreach (ILayer layer in _basicMap.MapFrame)
{
IGroup grp = layer as IGroup;
if (grp != null)
{
if (grp.LegendText == "KARTE")
{
// THIS SENTENCE IS NOT WORKING ???
grp.Remove(layer);
//geoMap1.Refresh();
//legend1.RefreshNodes();
}
}
}
Thanks for any help, Vojko
Re: mwToolStrip.cs
Posted by:
Shade1974 ()
Date: September 29, 2010 11:02AM
I will post this as a bug on DotSpatial. The "Remove" method should be functional here, so if it isn't working, there is likely an unexpected bug.
Shade1974 (Ted)
Dr. Harold A Dunsford Jr.
MapWindow 6.0 & DotSpatial Initial Developer
GEI Consultants
Shade1974 (Ted)
Dr. Harold A Dunsford Jr.
MapWindow 6.0 & DotSpatial Initial Developer
GEI Consultants
Sorry, you do not have permission to post/reply in this forum.


