From f940d5129b8842375b9e699222bb9eac6899c8b2 Mon Sep 17 00:00:00 2001
From: Anthony Borghi <anthony.borghi@veremes.com>
Date: Wed, 7 Nov 2018 16:27:01 +0100
Subject: [PATCH] =?UTF-8?q?Correction=20erreur=20de=20compilation=20sur=20?=
 =?UTF-8?q?impression=20et=20erreur=20si=20=C3=A9l=C3=A9ment=20non=20pr?=
 =?UTF-8?q?=C3=A9sent=20dans=20l'impression?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../module/javascript/app/vmap/tools/print.js | 38 +++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)

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 db3e75f1..c0c82271 100644
--- a/src/module_vmap/module/javascript/app/vmap/tools/print.js
+++ b/src/module_vmap/module/javascript/app/vmap/tools/print.js
@@ -375,18 +375,18 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.loadModelParmas2
     this.printBox_.setSize(this.printedMapSize_);
     this.printBox_.show();
 
-    if(this.$scope_.$root["compare_enabled"]){
-      this.setPrintedMapSize(this.template_,"#map1Compare","#map_image_compare");
-
-      // Pré-rempli le champ "Résolution"
-      this['resolutionCompare'] = this.resizeCoeff_;
-
-      // Ajuste l'échelle avec le niveau de détail
-      this['currentScaleCompare'] = oVmap.getMapCompare().getPrettyScale(oVmap.getMapCompare().getScale() / this.resizeCoeff_);
-
-      // Dessine un carré d'impression à chaque mouvement de la carte
-      this.printBoxCompare_.setSize(this.printedMapSize_);
-      this.printBoxCompare_.show();
+    if(this.$scope_["$root"]["compare_enabled"]){
+      if(this.setPrintedMapSize(this.template_,"#map1Compare","#map_image_compare") !== 0){
+        // Pré-rempli le champ "Résolution"
+        this['resolutionCompare'] = this.resizeCoeff_;
+
+        // Ajuste l'échelle avec le niveau de détail
+        this['currentScaleCompare'] = oVmap.getMapCompare().getPrettyScale(oVmap.getMapCompare().getScale() / this.resizeCoeff_);
+
+        // Dessine un carré d'impression à chaque mouvement de la carte
+        this.printBoxCompare_.setSize(this.printedMapSize_);
+        this.printBoxCompare_.show();
+      }
     }
 
 };
@@ -436,7 +436,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.setPrintedMapSiz
 
     // Vérifie la présence de '#map_image'
     if (!goog.isDef(imageDiv.get(0))) {
-        console.error('Aucune balise #map_image trouvée dans le template');
+        console.error('Aucune balise ' + sPrintId + ' trouvée dans le template');
         return 0;
     }
 
@@ -563,12 +563,12 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.prepareAndLaunch
     };
 
     // récupération des infos pour la carte de comparaison si le mode comparaison est actif
-    if(this.$scope_.$root["compare_enabled"]){
+    if(this.$scope_['$root']["compare_enabled"]){
       // Enregistre l'échelle actuelle
       this.currentScaleCompare_ = oVmap.getMapCompare().getScale({
           'pretty': true
       });
-      oPrintOptions['extentCompare'] = this.printBoxCompare_.getExtent();
+      oPrintOptions.extentCompare = this.printBoxCompare_.getExtent();
       //oPrintOptions['mapIdCompare'] = this.printBoxCompare_.getExtent();
     }
 
@@ -693,9 +693,9 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.print = function
             }
 
             if(goog.isDefAndNotNull(opt_options.extentCompare)){
-              oJsonDefOptions["extentCompare"] = opt_options.extentCompare;
-              oJsonDefOptions["mapIdCompare"] = opt_options.mapIdCompare;
-              oJsonDefOptions["mapImageSizeCompare"] = mapImageSizeCompare;
+              oJsonDefOptions.extentCompare = opt_options.extentCompare;
+              oJsonDefOptions.mapIdCompare = opt_options.mapIdCompare;
+              oJsonDefOptions.mapImageSizeCompare = mapImageSizeCompare;
             }
 
             var mapsJson = this_.getMapsJsonDef(oJsonDefOptions);
@@ -786,7 +786,7 @@ nsVmap.nsToolsManager.Print.prototype.printController.prototype.getMapsJsonDef =
     }
     if (goog.isDefAndNotNull(opt_options.mapIdCompare)) {
         sMapIdCompare = opt_options.mapIdCompare;
-    } else if (this.$scope_.$root["compare_enabled"]) {
+    } else if (this.$scope_['$root']["compare_enabled"]) {
         sMapJSONCompare = oVmap.getMapManager().getJSONLayersTree(true);
     }
 
-- 
GitLab