final MapModel styleMap = mapStyleModel.getStyleMap();
final String el = System.getProperty("line.separator");
if (styleMap == null) {
return;
}
final MapWriter mapWriter = Controller.getCurrentModeController().getMapController().getMapWriter();
final StringWriter sw = new StringWriter();
sw.append(el);
sw.append("<map_styles>");
sw.append(el);
final NodeModel rootNode = styleMap.getRootNode();
final boolean forceFormatting = Boolean.TRUE.equals(writer.getHint(MapWriter.WriterHint.FORCE_FORMATTING));
try {
mapWriter.writeNodeAsXml(sw, rootNode, Mode.STYLE, true, true, forceFormatting);
}
catch (final IOException e) {
e.printStackTrace();
}
sw.append("</map_styles>");