renderer.paint(g, viewport.getScreenArea(), viewport.getBounds());
return image;
}
private static Style createPointStyle() {
StyleFactory sf = CommonFactoryFinder.getStyleFactory();
URL iconUrl = ScreenMapShapefileTest.class.getResource("icon.png");
ExternalGraphic icon = sf.createExternalGraphic(iconUrl, "image/png");
Graphic graphic = sf.createGraphic(new ExternalGraphic[] { icon }, null, null, null, null,
null);
PointSymbolizer symbolizer = sf.createPointSymbolizer(graphic, "the_geom");
Rule rule = sf.createRule();
rule.symbolizers().add(symbolizer);
FeatureTypeStyle fts = sf.createFeatureTypeStyle();
fts.rules().add(rule);
Style style = sf.createStyle();
style.featureTypeStyles().add(fts);
return style;
}