Label ANGLE

Oct 21 at 7:42 PM
Hi

Am am testing this samples but I can not add Angle to the Label

'Error Additional information: Conversion from string "[ANGLE]" to type 'Double' is not valid.
    ' My_labelLayer.Symbology.Categories(0).Symbolizer.Angle = "[ANGLE]"

    My_labelLayer.Symbolizer.Angle = 90

  map1.FunctionMode = DotSpatial.Controls.FunctionMode.Pan

        Dim StreetLayer As IFeatureLayer = CType(map1.AddLayer("PATH\FILE.shp"), IFeatureLayer)
        Dim SymbStreetname As New PolygonSymbolizer(Color.FromArgb(0, 191, 0))
        SymbStreetname.SetFillColor(Color.Transparent)
        SymbStreetname.OutlineSymbolizer = New LineSymbolizer(Color.Transparent, 1)
        SymbStreetname.ScaleMode = ScaleMode.Simple
        StreetLayer.Symbolizer = SymbStreetname

        Dim My_labelLayer As New MapLabelLayer()
        StreetLayer.LabelLayer = My_labelLayer
        StreetLayer.ShowLabels = True


        My_labelLayer.Symbology.Categories(0).Expression = "[TEXTSTRING]"

        'Error  Additional information: Conversion from string "[ANGLE]" to type 'Double' is not valid.
        ' My_labelLayer.Symbology.Categories(0).Symbolizer.Angle = "[ANGLE]"

        My_labelLayer.Symbolizer.Angle = 90

        My_labelLayer.Symbolizer.ScaleMode = ScaleMode.Simple
        My_labelLayer.Symbolizer.Orientation = ContentAlignment.TopCenter
        My_labelLayer.Symbolizer.LabelPlacementMethod = LabelPlacementMethod.Centroid
        My_labelLayer.Symbolizer.PartsLabelingMethod = PartLabelingMethod.LabelLargestPart
        
        map1.Refresh()
Developer
Oct 23 at 6:48 PM
If you want to use an angle from a field use LabelAngleField instead of Angle and set UseLabelAngleField to true.
Angle can only take double values.