[OpenLayers-Users] Point symbolizer: triangle + orientation line

Arnd Wippermann arnd.wippermann at web.de
Sat Jul 28 05:48:03 PDT 2012


Perhaps you can solve your problem with OpenLayers.Geometry.Collection 

Example:
http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/Direction_Vectors/direction
_arrow_for_point_features.asp


Arnd
 

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Gabriel
Vatin
Gesendet: Freitag, 27. Juli 2012 17:13
An: Mr. Puneet Kishor
Cc: openlayers-users at lists.osgeo.org
Betreff: Re: [OpenLayers-Users] Point symbolizer: triangle + orientation
line

I had the same idea, but the thing is I'd like to use vector features : 
I have OL Rules to change the color according to some attributes.
Actually, I'd like to have this kind of result : 
http://blog.fleetmon.com/wp-content/uploads/2012/07/FleetMon-Explorer-live-r
eal-time-vessel-tracking-and-monitoring-Fleetmon.com-125-2-1024x581.jpg

But with the line at the top of the triangle (direction and speed, and not
passed trajectory).

Le 27/07/2012 17:08, Mr. Puneet Kishor a écrit :
> On Jul 27, 2012, at 10:18 AM, Gabriel Vatin
<gabriel.vatin at mines-paristech.fr> wrote:
>
>> Hello,
>>
>> I'd like to represent mobile objects (WFS layer of points) with a
triangle, and a line to show the direction and speed of it. Right now, I can
use the default "triangle" symbolizer :
>>
>> symbolizer: {
>> rotation: '${heading}',
>>     pointRadius: 6.5,
>>     graphicName: 'triangle',
>>     strokeColor: 'white',
>>     fillColor: color,
>>     strokeOpacity: 0.3,
>>     strokeWidth: 2,
>>     fillOpacity: 0.7
>> }
>>
>> Then I use the rotation attribute to turn the trangle. The triangle
object is a isosceles triangle, but it is so small that we can't really see
its orientation. So is there a method to draw a triangle and a line at the
top of it to show the direction ?
>> I just tried to add a new WFS layer with the same origin, but an other
symbolizer :
>>
>> defaultStyleD = new OpenLayers.Style({
>>     rotation: '${heading}',
>>     pointRadius: 25,
>>     externalGraphic: './img/line.png',
>>     graphicYOffset: -50
>> });
>>
>> The line.png is an image I made myself. If I display the 2 layers at the
same time, that's the kind of result that I want to see... but this is only
a trick, and not a real good way to answer my problem !
>> Do you have any idea ?
>>
>
> The above is too complicated. Instead, make one image of an arrow 
> (line with triangle showing direction), and then rotate and scale it 
> as needed. See example image at 
> http://dl.dropbox.com/u/3526821/gps.png
>
> --
> Puneet Kishor
>

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



More information about the Users mailing list