Skip to content

Commit

Permalink
Rename mergeLayers parameter to pdfA
Browse files Browse the repository at this point in the history
  • Loading branch information
gberaudo committed Oct 6, 2020
1 parent 972aafd commit 902f3f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,11 @@ public abstract class GenericMapAttributeValues {

/**
* Whether to merge all layers into one.
* This is great to reduce pdf size but need layers having the same imagebufferscaling.
* This is great to reduce pdf size but needs layers having an imagebufferscaling of 1.
* Also see the allowTransparency option of the print config.
*/
public Boolean mergeLayers;
@HasDefaultValue
public Boolean pdfA = null;

/**
* Constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public Output execute(final Input param, final ExecutionContext context)
}
final MapfishMapContext mapContext = createMapContext(mapValues);
boolean allowTransparency = param.template.isAllowTransparency();
if (mapValues.mergeLayers != null) {
allowTransparency = !mapValues.mergeLayers;
if (mapValues.pdfA != null) {
allowTransparency = !mapValues.pdfA;
}
final List<URI> graphics = createLayerGraphics(
param.tempTaskDirectory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testPrintClientConfig() {
assertTrue(json.toString(2), json.has(JSON_CLIENT_INFO));

final JSONObject required = json.getJSONObject(JSON_CLIENT_PARAMS);
assertEquals(required.toString(2), 15, required.length());
assertEquals(required.toString(2), 16, required.length());

assertElem(required, "requiredElem", "int", null, false);
assertElem(required, "pArray", "array", null, false);
Expand All @@ -65,7 +65,7 @@ public void testPrintClientConfig() {
assertElem(required, "useAdjustBounds", "boolean", "null", false);
assertElem(required, "longitudeFirst", "boolean", "null", false);
assertElem(required, "dpiSensitiveStyle", "boolean", "true", false);
assertElem(required, "mergeLayers", "boolean", "false", false);
assertElem(required, "pdfA", "boolean", "null", false);
assertEmbedded(required, false, "embedded");
assertEmbedded(required, true, "optionalEmbedded");

Expand Down Expand Up @@ -104,7 +104,7 @@ public void testPrintClientConfigWithDefaults() {
JSONObject json = new JSONObject(stringWriter.toString());

final JSONObject required = json.getJSONObject(JSON_CLIENT_PARAMS);
assertEquals(15, required.length());
assertEquals(16, required.length());

assertElem(required, "rotation", "double", "1", false);
JSONObject embeddedDefault = required.getJSONObject("embedded").getJSONObject(JSON_ATTRIBUTE_DEFAULT);
Expand Down

0 comments on commit 902f3f7

Please sign in to comment.