Labels on top of Polygons

Feb 17, 2011 at 2:23 AM

In version 4.7.5 if I drew a label and then a polygon that was filled, the label would appear on top of the filled polygon.  In version 4.8.2, the polygon hides the label text.

 For example.

Dim icolor As UInteger = System.Convert.ToUInt32(RGB(255, 255, 255))
myChart.AddLabelEx(theHandle, theText, icolor, OutProjectionX, OutProjectionY, MapWinGIS.tkHJustification.hjCenter, 0)
myChart.DrawWidePolygonEx(theHandle, xpoints, ypoints, ypoints.Length, icolor, True, 5)

Also, no matter what color I set, the label always prints out black.  The polygon changes color correctly.

Thanks in advance,
Greg

Developer
Feb 18, 2011 at 12:20 AM

Greg, 

could you provide a full sample with point coordinates and layer type (screen/spatial)? The code for drawing layers is messy and there are plans to rework it: http://mapwingis.codeplex.com/workitem/19225

But presently I have time for a quick fix only.

Regards,

Sergei

Feb 18, 2011 at 2:32 AM
sleschinski wrote:

Greg, 

could you provide a full sample with point coordinates and layer type (screen/spatial)? The code for drawing layers is messy and there are plans to rework it: http://mapwingis.codeplex.com/workitem/19225

But presently I have time for a quick fix only.

Regards,

Sergei


I have a layer with an image.  then I am just drawing some rectangles with labels inside with the code above.

I am first defining a NewDrawing

myChart.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList)

 

Greg

Feb 21, 2011 at 4:08 AM
sleschinski wrote:

Greg, 

could you provide a full sample with point coordinates and layer type (screen/spatial)? The code for drawing layers is messy and there are plans to rework it: http://mapwingis.codeplex.com/workitem/19225

But presently I have time for a quick fix only.

Regards,

Sergei


Sergei,

I have another bug while you are in that code.  I have two routines that draw on my map.  The first routine draws lines with DrawLineEx and I keep an array with the integer that is returned from each NewDrawing for the line I draw so I can remove specific lines if needed.  The other routine draws a box with DrawPolygonEx .  Again I keep track of the specific integer from NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyreferencedList).

If I use ClearDrawing(x) it will remove the line segments correctly.  However, it will NOT remove the polygon shapes.  However, if I use just DrawPolygon it will remove the polygons correctly.

Just an FYI while you are in the code.

Greg