mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);
mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
for (Layer<?> layer : map.getMapModel().getLayers()) {
if (layer instanceof VectorLayer) {
VectorLayer vectorLayer = (VectorLayer) layer;
VectorLayerRasterizingInfo vectorRasterizingInfo = new VectorLayerRasterizingInfo();
vectorRasterizingInfo.setPaintGeometries(true);
vectorRasterizingInfo.setPaintLabels(layer.isLabeled());
vectorRasterizingInfo.setShowing(layer.isShowing());
ClientVectorLayerInfo layerInfo = vectorLayer.getLayerInfo();
vectorRasterizingInfo.setStyle(layerInfo.getNamedStyleInfo());
if (vectorLayer.getSelectedFeatures().size() > 0) {
Set<String> selectedFeatures = vectorLayer.getSelectedFeatures();
vectorRasterizingInfo.setSelectedFeatureIds(selectedFeatures.toArray(new String[selectedFeatures
.size()]));
FeatureStyleInfo selectStyle = null;
switch (layerInfo.getLayerType()) {
case GEOMETRY:
break;
case LINESTRING:
case MULTILINESTRING:
selectStyle = mapInfo.getLineSelectStyle();
break;
case MULTIPOINT:
case POINT:
selectStyle = mapInfo.getPointSelectStyle();
break;
case MULTIPOLYGON:
case POLYGON:
selectStyle = mapInfo.getPolygonSelectStyle();
break;
}
selectStyle.applyDefaults();
vectorRasterizingInfo.setSelectionStyle(selectStyle);
}
layerInfo.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, vectorRasterizingInfo);
} else if (layer instanceof RasterLayer) {
RasterLayerRasterizingInfo rasterInfo = new RasterLayerRasterizingInfo();
ClientRasterLayerInfo layerInfo = (ClientRasterLayerInfo) layer.getLayerInfo();