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

rendering style of linestring layer

Topics: Algorithms, Data Access, SharpMap Project, SharpMap v0.9 / v1.x
Jun 24, 2008 at 5:46 AM
i want to render the linestring layer as the style like the 4th picture of Screenshots.
now i just merge all of the linestring features and buffer this merged feature and store as polygon layer. then render the polygon layer. this will cause the low velocity of reading shp file. My former thread of the low rendering speed of sharpmap cause some of the tiles can not display in openlayers. I think the problem is related to this rendering method.
Now, i want to render the linestring layer (street road layer) like the screenshot without merge all the features. and display label along to the feature direction. what work should i do? thanks. :-)
Jun 24, 2008 at 8:07 AM
Hi cdgrain, I think all you need to do is ensure that for your street layers' VectorStyle, the outline pen is wider than the line pen and EnableOutline is true. The label will be drawn along the line automatically for a line string. There are s few settings worth playing around with on the LabelStyle class. HTH jd
Jun 24, 2008 at 10:11 AM
hi, John. thanks for your reply
the outline pen is wider than the line pen? but from the picture, it is apparent that the line pen is wider than the outline pen. the outline pen is about 1px.
my code is:
primiaryRoad.Style.Line = new Pen(Color.Bisque, 7);
primiaryRoad.Style.Line.StartCap = System.Drawing.Drawing2D.LineCap.Round;
primiaryRoad.Style.Line.EndCap = System.Drawing.Drawing2D.LineCap.Round;
primiaryRoad.Style.Outline = new Pen(Color.Black, 1);
primiaryRoad.Style.Line.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
primiaryRoad.Style.EnableOutline = true;

when it run, the outline can not be rendered. if the width reverse(just you say), the line and outline can be rendered. but the style is not correct.
Jun 24, 2008 at 10:24 AM
The outline is drawn first so is underneath the line
Jun 25, 2008 at 9:18 AM
thanks john. i make it.
i don't know this issue is so simple.:(