IconProperties properties, KmlEncodingContext context) {
final Double opacity = properties.getOpacity();
final Double scale = properties.getScale();
final Double heading = properties.getHeading();
IconStyle is = style.createAndSetIconStyle();
if (opacity != null) {
is.setColor(colorToHex(Color.WHITE, opacity));
}
if (scale != null) {
is.setScale(scale);
}
if (heading != null) {
is.setHeading(heading);
}
// Get the name of the workspace
WorkspaceInfo ws =
context.getWms().getCatalog().getStyleByName(sld.getName()).getWorkspace();
String wsName = null;
if(ws!=null) wsName = ws.getName();
Icon icon = is.createAndSetIcon();
icon.setHref(properties.href(context.getMapContent().getRequest().getBaseUrl(),
wsName, sld.getName()));
}