From ce2724b2510e84e0ca3a7bbfdad193eba280333d Mon Sep 17 00:00:00 2001
From: Armand Bahi <armand.bahi@veremes.com>
Date: Mon, 7 Jan 2019 10:18:02 +0100
Subject: [PATCH] Comparaison : filtre non disponible sur la carte 1

---
 src/vitis/client/javascript/externs/mapJSON/MapJSON.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/vitis/client/javascript/externs/mapJSON/MapJSON.js b/src/vitis/client/javascript/externs/mapJSON/MapJSON.js
index 0d98c048..1f631eb3 100755
--- a/src/vitis/client/javascript/externs/mapJSON/MapJSON.js
+++ b/src/vitis/client/javascript/externs/mapJSON/MapJSON.js
@@ -597,8 +597,11 @@ MapJSON.prototype.getLayerFromLayerDef_ = function (oMapDefinition, oLayerDef, o
     }
     if (goog.isDefAndNotNull(oLayerDef['is_filtered'])) {
         if (goog.isDefAndNotNull(oLayerDef['filter_form'])) {
-            if (goog.isString(oLayerDef['filter_form']) && oLayerDef['filter_form'].length !== 0) {
-                oLayerDef['filter_form'] = JSON.parse(oLayerDef['filter_form']);
+            if ((goog.isString(oLayerDef['filter_form']) && oLayerDef['filter_form'].length !== 0) ||
+                goog.isObject(oLayerDef['filter_form'])) {
+                if (goog.isString(oLayerDef['filter_form'])) {
+                    oLayerDef['filter_form'] = JSON.parse(oLayerDef['filter_form']);
+                }
                 oLayerDef['filter_values'] = this.getFilterFormValues_(oLayerDef['filter_form']);
                 layer.set('filter_form', oLayerDef['filter_form']);
                 layer.set('filter_form_embedjs', oLayerDef['filter_form_embedjs']);
-- 
GitLab