This project has moved. For the latest updates, please go here.

LOAD WKT Polygon and add a label

Topics: Data Access, SharpMap v0.9 / v1.x, WinForms Controls
Mar 13, 2013 at 11:23 AM
I have a Winforms app that allows the user to load polygons from saved text files (polygons as WKT).

How do I add a label to the map for the loaded polygon?


Mar 13, 2013 at 11:52 AM
Add a SharpMap.Layers.LabelLayer.
For usage and configuration examples see the WinFormSamples project
Mar 13, 2013 at 12:58 PM
I have checked the Winforms examples.

labelLayer.datasource = MyPolygonWKT.datasource???
labelcolumn = ????

This is the snag... the datasource is a polygon in WKT format. If my file was called "MyPolygonWKT.txt" how do I get that as a label associated with the polygon on the map in my MapBox? How do I position the label (inside polygon or just above/below?

I can pull in labels from SHP files and others such as Access because there is a back end DB from which I can pull coordinates and/or the text for a label - how to associate a custom label to a loaded polygon? I will do another search of the discussions section of the SharpMap site... I may have missed something.

Mar 13, 2013 at 1:00 PM

Perhaps I should try this...