I solved my Point Icon question below with the following code snippet.
 However, the same concept does not appear to apply to LineString features.


     StyleBuilder sb = new StyleBuilder();
     Graphic graphic = sb.createGraphic();
     //remove the default symbol
     graphic.graphicalSymbols().clear();
     // create a new symbol
     ExternalGraphic eGr = sb.createExternalGraphic(SPRITE_IMAGE_URL,
"image/png");
     graphic.graphicalSymbols().add( eGr );

     // point symbolizer to use this symbol
     PointSymbolizer sym = sb.createPointSymbolizer(graphic);
     Rule iconRule = sb.createRule(sym);

        Stroke lineStroke = sb.createStroke(Color.BLUE, 1.0);
        LineSymbolizer lineSym = sb.createLineSymbolizer(lineStroke);
        Rule lineRule = sb.createRule(lineSym);

        //put all our rules together in a FeatureTypeStyle
        FeatureTypeStyle iconFts =
sb.createFeatureTypeStyle(pointFeatureType.getTypeName(), new
Rule[]{iconRule});
        FeatureTypeStyle lineFts =
sb.createFeatureTypeStyle(lineFeatureType.getTypeName(), new
Rule[]{lineRule});

        myStyle = sb.createStyle();
        myStyle.featureTypeStyles().add(iconFts);
        myStyle.featureTypeStyles().add(lineFts);

Are there any particular attributes that I need to have in my
lineFeatureType to get it to display?  Can anyone take a quick glance to
determine why the lines aren't showing up based on the styles?

When I'm dumping the features in the FeatureCollection, both the
pointFeatureType's and lineFeatureType's are present, but only the
pointFeatureType's display on the map.  I add them at the same time and
repaint afterwards, so I think it's more likely a Style problem than a
painting problem.  Additionally, the map layer for these features was added
to the map context with the "myStyle" Style.

The lineFeatureType has a "route" attribute (that I saw in some examples) of
the LineString.class type.  Is this the correct attribute to set in order to
properly construct a line feature?

I can't wait to update these docs once I've got my head wrapped around all
of this :-)

Thanks,
Brian

On Thu, May 6, 2010 at 10:44 PM, Jody Garnett <jody.garn...@gmail.com>wrote:

>
> On 07/05/2010, at 10:58 AM, Michael Bedward wrote:
>
> > On the user list we regularly ask people for feedback and
> > contributions to the wiki and web examples. But it's usually a lot
> > easier to get code contributions than it is to get help with the docs.
>
> That said Micheal there have been some good code examples on the list here
> we should cut and paste into the wiki ... in particular some of the
> GridCoverage discussion has been more useful then what is in the wiki.
>
> Jody
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>



-- 
Brian Ghigiarelli
570-878-9139
------------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to