diff --git a/src/module_vmap/module/javascript/app/vmap/tools/print.js b/src/module_vmap/module/javascript/app/vmap/tools/print.js index efc99e6add1af7135b89c9210efd195df339902c..2793857104885f3f6fccc29029d36c56aa77f091 100644 --- a/src/module_vmap/module/javascript/app/vmap/tools/print.js +++ b/src/module_vmap/module/javascript/app/vmap/tools/print.js @@ -635,10 +635,17 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function var printStyleId = opt_options.printStyleId; // Set includesJSON - var includesJson = JSON.stringify([{ + var aIncludes = [{ 'target': '#map_legend', - 'html': this_.getLegendTemplate() - }]); + 'html': this_.getLegendTemplate('#maplegend') + }]; + if(this.$scope_["$root"]["compare_enabled"]){ + aIncludes.push({ + 'target': '#map_legend_compare', + 'html': this_.getLegendTemplate('#compare_maplegend') + }); + } + var includesJson = JSON.stringify(aIncludes); // Set scope var oPrintScope = goog.isDefAndNotNull(opt_options.scope) ? opt_options.scope : {}; @@ -780,6 +787,10 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function return 1; }; +/** + * Get the maps JSON defs + * @param {object} opt_options + */ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef = function (opt_options) { oVmap.log('nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef'); @@ -928,11 +939,12 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getTemplateTarge /** * Get the html definition of the template with base64 images + * @param {string} sTarget * @returns {String} */ -nsVmap.nsToolsManager.Print.prototype.printController.prototype.getLegendTemplate = function () { +nsVmap.nsToolsManager.Print.prototype.printController.prototype.getLegendTemplate = function (sTarget) { - var template = $('#maplegend').clone(); + var template = $(sTarget).clone(); // Transforme les images en base64 template.find('img').each(function (index) {