hi again,
Im trying to add multiple(2) attribute types to a layer ( an arrow at the end of a line ), But the arrow apears int the centroid ( + or - ) of the line.
Does someone can help me?
Thx Fred.
 
here is the code:
 

...

AttributeType[] types = new AttributeType[2];

types[0] = AttributeTypeFactory.newAttributeType( "line", LineString.class );

types[1] = AttributeTypeFactory.newAttributeType( "arrow", Point.class );

...

multipointType = FeatureTypeFactory.newFeatureType( types, "multipointfeature" );

...

LineString multiPoint = geomFac.createLineString( points );

Point lastPoint = multiPoint.getEndPoint();   ///// ITS THE LAST POINT ( IVE CHECKED )

feature = multipointType.create( new Object[]{multiPoint, lastPoint} );

fc = FeatureCollections.newCollection();

fc.add( feature );

...

LineSymbolizer ls = sb.createLineSymbolizer( Color.BLACK, 3 );

Mark arrow= sb.createMark( StyleBuilder.MARK_ARROW, new Color( 64, 5, 186 ), new Color( 64, 5, 186 ),0 );

Graphic graph2 = sb.createGraphic( null, arrow, null, 1, 9, 0 );

PointSymbolizer pointSymb = sb.createPointSymbolizer( graph2 );

Rule r = sf.createRule();

r.setSymbolizers( new Symbolizer[]{ls, pointSymb} );

Style s = sf.createStyle();

s.setName( "arrowSTYLE" );

s.addFeatureTypeStyle( sf.createFeatureTypeStyle( new Rule[]{r} ) );

DefaultMapLayer calcLayer = new DefaultMapLayer( fc, s, calc.getNome() );

...

 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to