Show direction on street

Topics: SharpMap v0.9 / v1.x
Jan 24, 2012 at 12:44 PM


I'm trying to show directions on a street on my map. I'm using a MapBox and the street datasource is a shapefile. Right now im using a Vectorlayer for the layer and a customtheme where I set the Line.EndCap to a System.Drawing.Drawing2D.LineCap.ArrowAnchor on those streets that is oneway direction. This works and the end result is like this: =========> but I would like it to be like this (or similar): ==>==>==>==>. Is this possible, if so how?


Jan 24, 2012 at 2:03 PM

Use SharpMap.Layers.Symbolizer.LinealVectorLayer and define yourself a

SharpMap.Rendering.Symbolizer.WarpedLineSymbolizer that draws the arrows. An example of how to achive that is in the ExampleCodeSnipplets project.

IIRC there is a Patch/Issue fix on the site, that addresses the same problem. You might prefer that.

Hth FObermaier

Jan 24, 2012 at 2:40 PM

Hi, thanks for the quick answer!

I'm afraid I can't seem to find the example you are referring to. The problem with LinealVectorLayer seems to be that I can't put a custom theme on it and just have the roads that are oneway drawn as arrows (all roads are in the same shapefile and the .DBF file have information if the road is oneway or not). I've found the issue that you said ( and it seems more the approach I was hoping existed in SharpMap.

Jan 24, 2012 at 5:16 PM

For the record, here it is:

Jan 30, 2012 at 8:44 AM
Edited Jan 30, 2012 at 8:47 AM

In issue:

SharpMap.Rendering.WarpedLineSymbolizer ( I have not tested this). I add some code (only on my project ) like description of 31580 issue. It can apply for custom theme.