[OpenLayers-Users] How to draw a arrow with openlayer?

Arnd Wippermann arnd.wippermann at web.de
Fri Jan 25 02:25:27 PST 2013


Hi,
 
may be this examples can help:
 
approach like Imran described
http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/Line_Direction/direction_ar
row.asp
 
http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/Direction_Vectors/rotation_
of_simple_direction_vectors.asp
 
 
Arnd

  _____  

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von ???
Gesendet: Freitag, 25. Januar 2013 05:06
An: Imran Rajjad
Cc: openlayers-users at lists.osgeo.org
Betreff: Re: [OpenLayers-Users] How to draw a arrow with openlayer?


Hi Guys  

I got some process. 

But I have a problem to draw with the mouse, during the drawing, I can see
the angle. But when I double click, the angle gone. Any tips will help. 


Regards,
Hua Jie


On Thu, Jan 24, 2013 at 10:01 AM, 杨华杰 <yhjhoo at gmail.com> wrote:


Hi Imran 

Thanks for your reply. I believe a lot people have the same questions. Why
this feature is not released.


Regards,
Hua Jie


On Wed, Jan 23, 2013 at 10:28 PM, Imran Rajjad <rajjad at gmail.com> wrote:


Hi, 

you can make a feature whose geometry is a GeometryCollection, this
collection can contain a line and a point grouped into one geometry then you
can use the below mentioned style to draw an arrow with your line


{
strokeColor: "#00688B",
    fillColor: "#00688B",
    fillOpacity : 1.0,
    strokeWidth: 2,
    strokeOpacity : 0.9,
    pointRadius: 6,
    graphicName :"triangle",
    rotation :angle
}

remember to compute the angle before setting this .. you should be able to
calculate angle between start and end point of your line segment.. and also
the position of point geometry which will be drawn as triage with given
rotation angle..

Hope I got my point through..

regards,
Imran

On Wed, Jan 23, 2013 at 7:11 PM, 杨华杰 <yhjhoo at gmail.com> wrote:


Hi Alexandre 


Thank you, I will try this.




Regards,
Hua Jie


On Wed, Jan 23, 2013 at 10:01 PM, Alexandre Dubé <adube at mapgears.com>
wrote:


Hi Hua Jie,

You could try to define your own arrow symbol.  There's one defined  [here],
see line 1 :
  OpenLayers.Renderer.symbol.arrow = [0,2, 1,0, 2,2, 1,0, 0,2]

   I haven't tried it, but it could do the trick.

HTH,

Alexandre

[here]
http://code.google.com/p/rep-olnet/source/browse/trunk/Direction.js?r=61 



On 13-01-23 07:09 AM, 杨华杰 wrote:


Hi  

As the title


I know how to draw a line, dot, polygon. But my customer need some
directions on the map


Regards,
Hua Jie

 

_______________________________________________

Users mailing list

Users at lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/openlayers-users







-- 

Alexandre Dubé

Mapgears

www.mapgears.com



_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users





_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users






-- 

I.R 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130125/df87a082/attachment.html>


More information about the Users mailing list