I think you will need to draw triangle with the angle with an angle
between the starting and ending point of your line, Theoraticaly thats
how I would had done it.

regards,
Imran

On Wed, Nov 3, 2010 at 4:14 AM, Alexander Von Luenen
<[email protected]> wrote:
> Hi,
>
> I looked at the StyleLab examples and also found an archive entry for this 
> topic, but couldn't get it to work. I am trying to have my LineStrings with 
> an arrow at one end, and I use the following code to achieve that:
>
>   public static Style createLineStyle(Color farbe, boolean capped, int width) 
> {
>      Stroke stroke = null;
>
>      if(capped == true) stroke = styleFactory.createStroke(
>            filterFactory.literal(farbe),
>            filterFactory.literal(width),
>            null,
>            filterFactory.literal(ConstantExpression.constant("miter")),
>            filterFactory.literal(ConstantExpression.constant("arrow")),
>            null,
>            null,
>            null,
>            null);
>      else stroke = styleFactory.createStroke(filterFactory.literal(farbe), 
> filterFactory.literal(width));
>
>      /*
>       * Setting the geometryPropertyName arg to null signals that we want to
>       * draw the default geometry of features
>       */
>      LineSymbolizer sym = styleFactory.createLineSymbolizer(stroke, null);
>      Rule rule = styleFactory.createRule();
>      rule.symbolizers().add(sym);
>      FeatureTypeStyle fts = styleFactory
>            .createFeatureTypeStyle(new Rule[] { rule });
>      Style style = styleFactory.createStyle();
>      style.featureTypeStyles().add(fts);
>
>      return style;
>   }
>
> The layer is created with "new DefaultMapLayer(travels_col, 
> SEMStyleLab.createLineStyle(Color.RED, true, 1))".
>
> I debugged the code and the line cap is actually reported as being "arrow". 
> Am I missing anything?
>
> Thanks for your help.
>
> Cheers,
> Alex
>
>
>
> Dr Alexander von Lünen
> Leverhulme Research Fellow
> Dept. of Geography
> University of Portsmouth
> Buckingham Building, Lion Terrace
> Portsmouth, PO1 3HE, UK
> tel: +44-(0)23-9284-2500
> fax: +44-(0)23-9284-2512
>
>
>
> ------------------------------------------------------------------------------
> Achieve Improved Network Security with IP and DNS Reputation.
> Defend against bad network traffic, including botnets, malware,
> phishing sites, and compromised hosts - saving your company time,
> money, and embarrassment.   Learn More!
> http://p.sf.net/sfu/hpdev2dev-nov
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>



-- 
I.R

------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to