[guadec-web: 3/6] fixing global access to guadec map



commit 9ed82a801782edcf774f9daaa278366977bea67a
Author: Jorge Sanz <xurxosanz gmail com>
Date:   Mon Jul 2 11:14:45 2018 +0200

    fixing global access to guadec map

 content/pages/map.md            | 4 ++--
 src/js/guadec_map/guadec-map.js | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/content/pages/map.md b/content/pages/map.md
index db617ca..499ed7b 100644
--- a/content/pages/map.md
+++ b/content/pages/map.md
@@ -153,8 +153,8 @@ Date: 20180615
 
             return style
         },
-        /* You need to update this setting to DEV to allow working locally */
-        environment : 'DEV'
+        /* Try to detect development environment */
+        environment : window.location.href.search('localhost') != -1 ? 'DEV' : 'PROD'
     };
 
     var guadec_map = new GuadecMap(options);
diff --git a/src/js/guadec_map/guadec-map.js b/src/js/guadec_map/guadec-map.js
index a6d2e1a..b9d4595 100644
--- a/src/js/guadec_map/guadec-map.js
+++ b/src/js/guadec_map/guadec-map.js
@@ -549,4 +549,6 @@ class GuadecMap {
             context._get_routes(context,all_geom_ids);
         });
     }
-}
\ No newline at end of file
+}
+
+window.GuadecMap = GuadecMap;
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]