Hi List !
I'm still working on styles and I have create a TextSymbolizer that
indicates the value of my linear shaped feature.
I don't use SLD file but rather create my styles programmatically.
I want to do two things with my text :
- first, I want it to be centered with respect to the associated
LineSymbolizer. By default, the start of the text matches the line
center. I would like the middle of the text to match the line center
- then, I would like to format the displayed text in a format like
XX.XX. To do that, I think I have to access the String of my Feature
attribute and format it on the fly
I think I need to use visitors, but I'm really not sure how they work.
Does anyone have a code sample ?
Thanks
----
// Creates the style builder
StyleBuilder sb = new StyleBuilder();
// Creates the text symbolizer
TextSymbolizer text = sb.createTextSymbolizer(Color.black, sb
.createFont(new Font("sansserif", Font.PLAIN, 12)), "depth");
// Adds it to a rule
Rule rule1 = sb.createRule(text);
// Creates the line symbolizer
LineSymbolizer lineSymbolizer = sb.createLineSymbolizer(Color.red, 2.0);
// Adds it to another rule
Rule rule2 = sb.createRule(lineSymbolizer);
// And so on...
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users