Hi,

i am trying to  draw point features  using a PointSymbolizer. I founde 
this code on the userguide page:

StyleBuilder styleBuilder = new StyleBuilder();
        Style style = styleBuilder.createStyle();        
        {
            {   PointSymbolizer pointSymbolizer = 
styleBuilder.createPointSymbolizer();
            
                {   Graphic graphic = styleBuilder.createGraphic();
                    ExternalGraphic external = 
styleBuilder.createExternalGraphic( "file:///C:/images/house.gif", "image/gif");
                    graphic.graphicalSymbols().add( external );
                    graphic.graphicalSymbols().add( 
styleBuilder.createMark("circle"));
                    
                    pointSymbolizer.setGraphic(graphic);
                }
                Rule rule = styleBuilder.createRule(pointSymbolizer);           
 
                FeatureTypeStyle featureTypeStyle = 
styleBuilder.createFeatureTypeStyle("Feature", rule );
                style.featureTypeStyles().add( featureTypeStyle );
            }
        }

so i tried this code:
 
Graphic gr = styleFactory.createDefaultGraphic();

            Mark mark = styleFactory.getCircleMark();

            mark.setStroke(styleFactory.createStroke(
                    filterFactory.literal(Color.BLUE), 
filterFactory.literal(1)));

            
mark.setFill(styleFactory.createFill(filterFactory.literal(Color.CYAN)));
           * ExternalGraphic external = 
styleFactory.createExternalGraphic( "file:///C:/images/exiticon.gif", 
"image/gif");*

            gr.graphicalSymbols().clear();
            gr.graphicalSymbols().add(external );
           // gr.graphicalSymbols().add(mark);
            gr.setSize(filterFactory.literal(5));

            /*
             * Setting the geometryPropertyName arg to null signals that 
we want to
             * draw the default geomettry of features
             */
            PointSymbolizer sym = styleFactory.createPointSymbolizer(gr, 
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;

but the image wasn`t showed => the image exists!

Hopefully you can help me!

Thanks

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to