Skip to content

Commit

Permalink
feat(core): turn off bounding boxes when exporting
Browse files Browse the repository at this point in the history
In normal browsers (not IE9-10), turn off boudning boxes as they can be converted to canvas.

Signed-off-by: Aleksuei Riabtsev <aleksuei.riabtsev@ec.gc.ca>
  • Loading branch information
AleksueiR committed Jul 6, 2015
1 parent c0b0f16 commit 679badd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/js/RAMP/Modules/imageExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,11 @@ define([
if (visState.empty) {
visState.empty = false;

var youHaveIE = RAMP.flags.brokenWebBrowser || RAMP.flags.ie10client;

//go through feature layer config
RAMP.config.layers.feature.forEach(function (fl) {
var flObj = RAMP.layerRegistry[fl.id],
youHaveIE = RAMP.flags.brokenWebBrowser || RAMP.flags.ie10client;
var flObj = RAMP.layerRegistry[fl.id];

//find if feature layer, user added, visible, and has no URL
if (flObj.visible) { // turn off all visible feature layers, unless you have IE - then turn off only visible user layers
Expand All @@ -365,6 +366,17 @@ define([
}
}
});

// turn off bounding boxes if you don't have IE as they can be converted svg -> canvas faster
Object.keys(RampMap.getBoundingBoxMapping()).forEach(function (key) {
var bb = RampMap.getBoundingBoxMapping()[key];

if (bb.visible && !youHaveIE) {
//turn off visibility. remember the layer
bb.setVisibility(false);
visState.layers.push(bb);
}
});
}
}

Expand Down

0 comments on commit 679badd

Please sign in to comment.