Label Layer - how to avoid error: An entry with the same key already exists!

Topics: Algorithms, SharpMap v0.9 / v1.x
Oct 15, 2013 at 9:47 AM
I have my label layer style set like this:

case "Practicability":
resultLayer = new SharpMap.Layers.LabelLayer("timduonggt")
                {
                    DataSource = VectorLayer.DataSource,
                    Enabled = true,
                    LabelColumn = "tenduong",
                    MultipartGeometryBehaviour = SharpMap.Layers.LabelLayer.MultipartGeometryBehaviourEnum.Largest,
Style = new SharpMap.Styles.LabelStyle()
                    {
                        ForeColor = System.Drawing.Color.Black,
                        Font = new System.Drawing.Font(System.Drawing.FontFamily.GenericSerif, 13),
                        HorizontalAlignment = SharpMap.Styles.LabelStyle.HorizontalAlignmentEnum.Center,
                        VerticalAlignment = SharpMap.Styles.LabelStyle.VerticalAlignmentEnum.Middle,
                        //Offset = new System.Drawing.PointF(3, 3),
                        //Halo = new System.Drawing.Pen(System.Drawing.Color.White, 2),
                        //CollisionDetection = true,
                        MaxVisible = 12391,                        
                    }
                }; 
but get error: An entry with the same key already exists!
Help me plz. Thanks All.
Oct 15, 2013 at 9:58 AM