From 1ccb1a8bd04c4ae88001d56b42d80f0d3b558a4f Mon Sep 17 00:00:00 2001
From: Armand Bahi <armand.bahi@veremes.com>
Date: Wed, 7 Nov 2018 16:36:57 +0100
Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20l'=C3=A9chelle=20lors=20du=20ch?=
 =?UTF-8?q?argement=20de=20la=20carte?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../javascript/app/vmap/map/mapcompare.js     | 52 ++++++++++---------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js b/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js
index f08edde3..37bbe8ae 100644
--- a/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js
+++ b/src/module_vmap/module/javascript/app/vmap/map/mapcompare.js
@@ -477,31 +477,35 @@ nsVmap.MapCompare.prototype.mapCompareController = function ($scope, $window, $e
     this.map.setTarget('olMapCompare');
 
     $scope.$on("mapCompareChanged", function(){
-      // MAJ de la taille du composant
-      this_.map.setSize([document.getElementById('olMapCompare').offsetWidth, document.getElementById('olMapCompare').offsetHeight]);
-      if (this_.map.getLayers().getArray().length > 0)
-          this_.map.getLayers().clear();
-
-      var tree_ = oVmap.getMapManager().getCompareLayersTree();
-      var olView_ = oMapJSON.getViewFromDef(tree_, {
-          'size': this_.map.getSize(),
-          'tileSize': tileSize
-      });
-
-      var olLayers_ = oMapJSON.getLayersFromDef(tree_, {
-          'size': this_.map.getSize(),
-          'tileSize': tileSize
-      });
-      // Définit la vue de la carte
-      this_.addView(olView_);
-      // Définit les couches de la carte
-      for (var i = 0; i < olLayers_.length; i++) {
-          this_.addLayer(olLayers_[i]);
-      }
-      $timeout(function(){
-        this_.synchronizeMap();
-      }, 10);
+        // MAJ de la taille du composant
+        this_.map.setSize([document.getElementById('olMapCompare').offsetWidth, document.getElementById('olMapCompare').offsetHeight]);
+        if (this_.map.getLayers().getArray().length > 0)
+        this_.map.getLayers().clear();
+
+        var tree_ = oVmap.getMapManager().getCompareLayersTree();
+        var olView_ = oMapJSON.getViewFromDef(tree_, {
+            'size': this_.map.getSize(),
+            'tileSize': tileSize
+        });
 
+        var olLayers_ = oMapJSON.getLayersFromDef(tree_, {
+            'size': this_.map.getSize(),
+            'tileSize': tileSize
+        });
+        // Définit la vue de la carte
+        this_.addView(olView_);
+        // Définit les couches de la carte
+        for (var i = 0; i < olLayers_.length; i++) {
+            this_.addLayer(olLayers_[i]);
+        }
+        $timeout(function(){
+            this_.synchronizeMap();
+        }, 10);
+
+        // Rafraichit l'échelle
+        setTimeout(function () {
+            this_.updateCompareScaleMap();
+        });
     })
 
     /**
-- 
GitLab