Dotspatial legend

Dec 6, 2012 at 3:58 AM

Hi All,

I am using dotspatial legend for display of S57 dataset in my application , where I am using C# as my coding

I could see layers list in legend but unable to get the layers name in legend, if anybody worked on it please let me know how to do it.

Dec 7, 2012 at 8:07 AM

           This is my code for solve your problem,

           List<ILegendItem> rootNodes = this.legend1.RootNodes;
            ILegendItem one = rootNodes[0];
            IEnumerable <ILegendItem> Nodes = one.LegendItems;
            foreach (ILegendItem node in Nodes)
            {
                if(node.IsSelected )
                Console.WriteLine(node.LegendText);
            }

 

 

Dec 13, 2012 at 8:35 AM

Hey Thanks for the response , here with the code given above in which event shall i write this code

Dec 13, 2012 at 9:49 AM

Some how I got the layers(object name ) in the legend .

If I have 30 feature set for a single object , it is displaying all the features , here i want to group 30 features of same object as a single unit rather than 30 different .

How do we group all the features into respective objects.

Jun 11, 2013 at 2:36 AM
How did u manage it for me it aint working as well.....
Jul 15, 2013 at 10:16 PM
I do this here with this command
       pPointMapLayer.LegendText = "Binnen of buiten onderzoeksgebied"
            Dim Layer As IMapLayer = Form1.myVenster.Layers.Add(fsAdres)
            Dim pPointMapLayer As IMapFeatureLayer
            If Layer IsNot Nothing Then
                If Layer.ProjectionString Is Nothing Then
                    Layer.Projection = DefineProjection()
                End If
                fsAdres = TryCast(Layer.DataSet, IFeatureSet)
                pPointMapLayer = TryCast(Layer, IMapFeatureLayer)
                pPointMapLayer.Symbology = SetSwungOnderzoeksgebieden(fsAdres)
                pPointMapLayer.LegendText = "Binnen of buiten onderzoeksgebied"
                ' *************************************************************************
                ' *  VOEG DATA TOE AAN STATUSBAR en LOGBOEK
                ' *************************************************************************
                statusTEKST = "Laag Adressen_Op_Onderzoeksgebieden gemaakt en weergegeven"
                Form1.ProgramStatusLabel.Text = statusTEKST
                frmDMClogboek.LogboekListBox.Items.Add(statusTEKST)
                Return
                fsAdres = Nothing
            Else
                Return
            End If