From 19cc2916186ed6e233c6b14696492345e6b7769f Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 23 Nov 2016 15:35:22 +0100
Subject: [PATCH] layout id should be integer

---
 frontend-js/src/main/js/map/CustomMap.js      |  1 +
 frontend-js/src/test/js/map/CustomMap-test.js | 21 +++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/frontend-js/src/main/js/map/CustomMap.js b/frontend-js/src/main/js/map/CustomMap.js
index 3322a01bd5..a96b5c7403 100644
--- a/frontend-js/src/main/js/map/CustomMap.js
+++ b/frontend-js/src/main/js/map/CustomMap.js
@@ -284,6 +284,7 @@ CustomMap.prototype.openLayout = function(identifier) {
  *          identifier of the layout to present
  */
 CustomMap.prototype.openLayoutById = function(identifier) {
+  identifier = parseInt(identifier);
   logger.debug("Opening layout: " + identifier);
   var index = null;
   for (var i = 0; i < this.getLayouts().length; i++) {
diff --git a/frontend-js/src/test/js/map/CustomMap-test.js b/frontend-js/src/test/js/map/CustomMap-test.js
index 542a4dd72e..04839edb3d 100644
--- a/frontend-js/src/test/js/map/CustomMap-test.js
+++ b/frontend-js/src/test/js/map/CustomMap-test.js
@@ -28,6 +28,18 @@ describe('CustomMap', function() {
     var map = new CustomMap(options);
     assert.ok(map);
   });
+  
+  it("customizeGoogleMapView", function() {
+    var map = helper.createCustomMap();
+    map.customizeGoogleMapView();
+  });
+  
+  it("customizeGoogleMapView 2", function() {
+    var map = helper.createCustomMap();
+    map.customizeGoogleMapView(true);
+  });
+  
+  
 
   it("openLayoutById (not existing)", function() {
     var map = helper.createCustomMap();
@@ -44,6 +56,15 @@ describe('CustomMap', function() {
     assert.equal(logger.getErrors().length, 0);
   });
 
+  it("openLayout (string id)", function() {
+    var options = helper.createCustomMapOptions();
+    var model = options.getProject().getModel();
+    var layout = model.getLayouts()[0];
+    var map = new CustomMap(options);
+    map.openLayoutById(layout.getId()+"");
+    assert.equal(logger.getErrors().length, 0);
+  });
+
   it("addSelectedLayout", function() {
     var layoutId = 90;
     var retreiveActiveAliasesForLayoutCount = 0;
-- 
GitLab