@Override
public Feature decorate(Feature feature, KmlEncodingContext context) {
Document doc = (Document) feature;
// create the screen overlay
ScreenOverlay go = doc.createAndAddScreenOverlay();
go.setName("Legend");
go.setOverlayXY(createPixelsVec(0, 0));
go.setScreenXY(createPixelsVec(10, 20));
// build the href
Icon icon = go.createAndSetIcon();
String legendOptions = (String) context.getRequest().getRawKvp().get("LEGEND_OPTIONS");
String[] kvpArray = null;
if (legendOptions != null) {
kvpArray = new String[] { "LEGEND_OPTIONS", legendOptions };
}