Details
Description
Hi,
I'm creating PointSymbolizer, LineSymbolizer, and PolygonSymbolizer's with the opacity set for each as follows:
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
Mark mark = styleFactory.createMark(filterFactory.literal(shapeWktName),
null,
styleFactory.createFill(filterFactory.literal(color), filterFactory.literal(opacity)),
filterFactory.literal(size), // size
filterFactory.literal(0)); // rotation
Graphic graphic = styleFactory.createGraphic(null,
new Mark[] {mark},
null,
filterFactory.literal(opacity), // opacity
filterFactory.literal(size), // size
null); // rotation
return styleFactory.createPointSymbolizer(graphic, null);
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
return styleFactory.createLineSymbolizer(styleFactory.createStroke(filterFactory.literal(color), filterFactory.literal(size), filterFactory.literal(opacity)), null);
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
return styleFactory.createPolygonSymbolizer(styleFactory.createStroke(filterFactory.literal(outerColor), filterFactory.literal(outerSize)),
styleFactory.createFill(filterFactory.literal(innerColor), filterFactory.literal(opacity)),
null);
When adding Styles to a MapContext that have Rules that use these symbolizers the resulting image is what I expect. The opacity values are used correctly when generating the images.
However, when creating a legend I am using Glyph.point(Rule)/line(Rule)/Polygon(Rule) to generate the legend image icons. For the Polygon image the legend image opacity matches the Rule that is passed in. For point and line, however, the opacity does not change with respect to the Rule.
I've attached a couple of files with minor code changes that fix the issue for me in case they help. Not sure if they are 100% correct or not but at least point out where I think the problems lie.