Commit 4a1fd8ad authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix on export image of nested view (it's disabled now) issue #35

parent dce43767
......@@ -1140,9 +1140,8 @@ public class ExportBean extends AbstractManagedBean {
return;
}
Model colorModel = null;
Model colorModel = new CopyCommand(originalModel).execute();
if (layout.getInputData() != null) {
colorModel = new CopyCommand(originalModel).execute();
ColorSchemaReader reader = new ColorSchemaReader();
Collection<ColorSchema> schemas = reader.readColorSchema(layout.getInputData().getFileContent());
new ColorModelCommand(colorModel, schemas).execute();
......@@ -1150,10 +1149,17 @@ public class ExportBean extends AbstractManagedBean {
// this might not return true if we change CLEAN.title in future...
// if it's clean then remove coloring
colorModel = new CopyCommand(originalModel).execute();
new ColorModelCommand(colorModel, new HashSet<>()).execute();
} else {
colorModel = originalModel;
}
for (Alias alias : colorModel.getAliases()) {
alias.setVisibilityLevel(0);
}
Integer level = Configuration.MIN_ZOOM_LEVEL;
try {
level = Integer.valueOf(clientData.getZoomLevel());
} catch (NumberFormatException e) {
logger.error("Problem with getting zoom level", e);
}
// transform polygon
......@@ -1176,12 +1182,6 @@ public class ExportBean extends AbstractManagedBean {
pathIter.next();
}
Double scale = Math.max(originalModel.getHeight(), originalModel.getWidth()) / (originalModel.getTileSize());
int level = Configuration.MIN_ZOOM_LEVEL;
try {
level = Integer.valueOf(clientData.getZoomLevel());
} catch (NumberFormatException e) {
logger.error("Problem with getting zoom level", e);
}
for (int i = level; i > Configuration.MIN_ZOOM_LEVEL; i--) {
scale /= 2;
......@@ -1193,7 +1193,7 @@ public class ExportBean extends AbstractManagedBean {
height((maxY - minY) / scale).//
width((maxX - minX) / scale).//
level(level).//
nested(layout.isHierarchicalView()).//
nested(false).// automatically set nested view as invalid
scale(scale).//
model(colorModel);
List<Integer> visibleLayoutIds = deserializeIdList(visibleLayouts);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment