How to place label of the polygon in the visible area of the map

Oct 11, 2012 at 10:03 AM

We are developing application using sharpmap.

In our application we want to place the label of the polygon inside visible area of the map.

We set MultipartGeometryBehaviour with MultipartGeometryBehaviourEnum.Larget. So label placing the inside of the polygon.

Its working fine in the full map on the screen i.e zoomfit on the screen. But when we go for zoomin operations, When some part of the polygon visible on the screen, we unable to see the label on the screen since label always places in the middle of the polygon.

But we have require that all visible polygons should be labled on the screen. How to do this dynamically? Thanks in advance.

And also we have another question How to assign multiple labels on the map at a time?

subbu

Coordinator
Oct 17, 2012 at 7:11 AM
MSsubrahmanyam wrote:

But we have require that all visible polygons should be labled on the screen. How to do this dynamically? Thanks in advance.

You need to clip your results with the viewport. In case of the ShapeFile provider you can add a FilterDelegate that performs this operation. If you use other providers you may need to modify the codebase and provide a patch...

And also we have another question How to assign multiple labels on the map at a time?

You can add as many LabelLayers as you like.
You can assign a label column delegate, that combines any attributes to a label string.

Hth FObermaier

Oct 30, 2012 at 5:18 AM

Can you please provide sample code for this problem? I am unable to get the solution.

 

Thanks and regards,

subrahmanyam