Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

New Post: Legendheader text of layer wont appear in legend

$
0
0
I have a working programm which converts access input 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

Viewing all articles
Browse latest Browse all 3973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>