@Override
protected void encodePlacemarkDescription(SimpleFeature feature, FeatureTypeStyle[] styles)
throws IOException {
// look for a kml text style with the description attribute
List<TextSymbolizer2> textSymbolizers = getTextSymbolizers2(feature, styles);
Expression description = null;
for (TextSymbolizer2 ts : textSymbolizers) {
if(ts.getFeatureDescription() != null)
description = ts.getFeatureDescription();
}
if(description == null) {
// use the freemarker template as a fallback
super.encodePlacemarkDescription(feature, styles);
return;
}
start("description");
cdata(description.evaluate(feature, String.class));
end("description");
}