Polyline Labels not working

Mar 28, 2016 at 11:32 AM
I've just run into another problem - I can't get labels to appear on polylines.
shape->Labels->set_FrameType(tkLabelFrameType::lfPointedRectangle);
shape->Labels->FrameVisible = true;
shape->Labels->set_Positioning(tkLabelPositioning::lpCenter);
shape->Labels->Generate(L"[Name]",tkLabelPositioning::lpCenter, true) ;
shape->Labels->Visible = true;
The above works for point shapefiles and the labels appear, but I think I am missing something with polylines.... I seem to remember that there were some extra steps involved, but that may be me misremembering.
I've tried GenerateLabels but no joy.
I've looked through the examples and can't seem to find anything about polyline labels.
I'm using the latest version - 4.9.4

Any help appreciated

regards

BB
Mar 28, 2016 at 11:53 AM
I have this workimg (4.8.6)
shpfile_cont = new MapWinGIS.ShapefileClass();

//open the shapefile
shpfile_cont.Open(mapFile, this);
grid.AssignNewProjection(shpfile_cont.Projection);

// generate labels
if (bContour)
{
shpfile_cont = new MapWinGIS.ShapefileClass();

//open the shapefile
shpfile_cont.Open(mapFile, this);
grid.AssignNewProjection(shpfile_cont.Projection);
shpfile_cont.Labels.Generate("[Grid_value]", MapWinGIS.tkLabelPositioning.lpLongestSegement, true);
//add the shapefile to the map and legend
handle = legend1.Layers.Add(shpfile_cont, true);
}

2016-03-28 13:32 GMT+02:00 BlueBeret <[email removed]>:

From: BlueBeret

I've just run into another problem - I can't get labels to appear on polylines.
shape->Labels->set_FrameType(tkLabelFrameType::lfPointedRectangle);
shape->Labels->FrameVisible = true;
shape->Labels->set_Positioning(tkLabelPositioning::lpCenter);
shape->Labels->Generate(L"[Name]",tkLabelPositioning::lpCenter, true) ;
shape->Labels->Visible = true;
The above works for point shapefiles and the labels appear, but I think I am missing something with polylines.... I seem to remember that there were some extra steps involved, but that may be me misremembering.
I've tried GenerateLabels but no joy.
I've looked through the examples and can't seem to find anything about polyline labels.
I'm using the latest version - 4.9.4

Any help appreciated

regards

BB

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Mar 29, 2016 at 12:33 AM
Cheers velsto!

That worked like a charm...... Many thanks.

BB