This project has moved and is read-only. For the latest updates, please go here.

Label collision

Topics: Algorithms, SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0
Jun 11, 2013 at 6:52 PM
I’m using sharp map and I’m having problems with labels…. like image below… !


I have used the following code:

SharpMap.Layers.LabelLayer layLabel = new SharpMap.Layers.LabelLayer("labels");
layLabel.Style = new SharpMap.Styles.LabelStyle();
layLabel.Style.ForeColor = Color.Black;
layLabel.Style.Font = new Font("Tahoma", 12);
layLabel.DataSource = ds;
layLabel.Enabled = false;
layLabel.LabelColumn = pSet.sLabelField;
layLabel.Style.CollisionDetection = true;

What am I doing wrong?
Jun 12, 2013 at 6:57 AM
You need to
  • set the PriorityColumn or a PriorityDelegate
  • set the LabelFilter method to Thorough
  • Adjust the CollisionBuffer
Hth FObermaier