diff --git a/frontend-js/src/main/js/map/CustomMap.js b/frontend-js/src/main/js/map/CustomMap.js index 3322a01bd543d1359a5a9ec63dc480759f629bf2..a96b5c7403fe74b955febe8b24ddc96cfa706b37 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 542a4dd72eb25d7b2c810394b77a67846d2454ed..04839edb3d74d997f8fc36f0ff1122508a311533 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;