On 6/29/07, Nikos <[EMAIL PROTECTED]> wrote:

Hello, I'm trying to use a JMapPane to display some data, but I get
nothing. I haven't found a jmappane example and so I'm just guessing how to
use it, the code I've written is this :



The example is in gt-demo-mappane, but you're doing quite well. The problem
is that getDefaultStyle() doesn't actually give you a style that draws
anything by default. Its probably a bad name for the method but I guess it
made sense when we wrote it.

So if you build your self a style using some code like:

StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);
       FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(new Hints(
               null));
       Literal wellKnownName = ff.literal("circle");
       org.opengis.filter.expression.Expression size = ff.literal(2);
       StyleBuilder sb = new StyleBuilder();

       Fill fill = factory.createFill(sb.colorExpression(Color.green));
       org.opengis.filter.expression.Expression rotation = ff.literal(0);
       Stroke stroke = sb.createStroke(Color.black);
       Mark mark = factory.createMark(wellKnownName, stroke, fill, size,
               rotation);
       Graphic graphic = sb.createGraphic(null, mark, null);
       Symbolizer symbolizer = sb.createPointSymbolizer(graphic);

       Style[] style = new Style[1];
       style[0] = sb.createStyle(symbolizer);

then you should see something.

Ian

--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to