This project is read-only.

Legendheader text of layer wont appear in legend

May 25, 2013 at 3:55 AM
Edited May 28, 2013 at 1:09 AM
I have a working programm which converts accesdata to layers.... here is part of the code...
My problem is that in the second part, a function where i make the legend... the layername doesnt show in the legend....

pPointSym.LegendText = "Onderzoeksgebied"

although the categories-symbology appear in the right way in the legend the name does not
and i think as a cause by it i cant select the layer either....

so the question is, what am i missing?
            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)
                Return
                fsAdres = Nothing
            Else
                Return
            End If
    Public Function SetSwungOnderzoeksgebieden(ByVal pfs As IFeatureSet) As IFeatureScheme
        Dim pPointSym As IPointSymbolizer = New PointSymbolizer
        Dim pScheme As IFeatureScheme
        Dim category1 As IPointCategory = New PointCategory(System.Drawing.Color.DarkRed, DotSpatial.Symbology.PointShape.Rectangle, 6.0)
        Dim category2 As IPointCategory = New PointCategory(System.Drawing.Color.LightGreen, DotSpatial.Symbology.PointShape.Rectangle, 8.0)
           Try
            pScheme = New PointScheme()
            pPointSym.LegendText = "Onderzoeksgebied"
            category1.FilterExpression = "[BinnenOnderzoeksgebied] = false"
            category1.LegendText = "Buiten onderzoeksgebied"
            category2.FilterExpression = "[BinnenOnderzoeksgebied] = true"
            category2.LegendText = "Binnen onderzoeksgebied"
            pScheme.AddCategory(category1)
            pScheme.AddCategory(category2)
            Return pScheme
        Catch ex As Exception
            MsgBox(ex.ToString, MsgBoxStyle.Critical, "Fout in SetSwungOnderzoeksgebieden")
            Return Nothing
        End Try
    End Function
May 28, 2013 at 1:10 AM
I am wondering if this is caused that a FID (?) is missing?

this problem doesnt occur when i load an excisting shape....