[OpenLayers-Users] Change Style Line

Andreas Hocevar ahocevar at opengeo.org
Wed Feb 25 08:50:38 EST 2009


Hi,

On Wed, Feb 25, 2009 at 8:19 AM, NN SS <nsanchezb08 at gmail.com> wrote:
> I have a problem.
> I need to draw an arrow instead line ( For exmaple :
> -->-->-->--ye>-->-->-->-->-- )  to join two or more points,
>
> How I can do this ?

Doing this with a line style is not possible in OpenLayers. What you
could do is walk through your line vertices and add create point
features from them, calculating the angle from the adjacent line
segments. Then you can style the points according to your needs, with
a rotation symbolizer property. Dashed and dotted lines are also
possible. See the following examples for further reference:

http://www.openlayers.org/dev/examples/vector-features.html shows a
dash-dotted line
http://www.openlayers.org/dev/examples/styles-rotation.html shows rotation
http://www.openlayers.org/dev/examples/styles-context.html shows how
to style features using information from their attrbutes

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list