diff --git a/CHANGELOG b/CHANGELOG index 37d26a057ce577fbd253627b343b441d744c2cfa..3e476a9e7d4ddd5013cc69d1b8ef4d1597f7022a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -31,6 +31,8 @@ minerva (12.3.1~beta.1) unstable; urgency=low * Bug fix: pathways can be drawn using glyphs (#825) * Bug fix: empty background overlay doesn't show glyphs, instead standard visualization is used (#826) + * Bug fix: asynchronous cals on showing/hiding data overlays might cause + problems due to network latency (#830) minerva (13.1.0~beta.0) unstable; urgency=low * Feature: annotators are more flexible - you can define set of input and diff --git a/frontend-js/src/main/js/map/surface/AliasSurface.js b/frontend-js/src/main/js/map/surface/AliasSurface.js index b78839878d8233640946ddbbfdf366bd09ad3567..c0f5ae6654e3b9b06e07385c98cead852ab04062 100644 --- a/frontend-js/src/main/js/map/surface/AliasSurface.js +++ b/frontend-js/src/main/js/map/surface/AliasSurface.js @@ -177,7 +177,11 @@ AliasSurface.prototype.setBoundsForAlias = function (startX, endX) { var pointB = new Point(alias.getX() + endX * alias.getWidth(), alias.getY() + alias.getHeight()); var bounds = new Bounds(pointA, pointB); - this.getMapCanvasObjects()[0].setBounds(bounds); + + var mapCanvasObjects = this.getMapCanvasObjects(); + for (var i = 0; i < mapCanvasObjects.length; i++) { + mapCanvasObjects[i].setBounds(bounds); + } }; /** diff --git a/frontend-js/src/test/js/map/surface/AliasSurface-test.js b/frontend-js/src/test/js/map/surface/AliasSurface-test.js index 4c98a6eb0db1934f67c8ddf5868744e2b0377a93..db8483335b0aba7ed009b2cca0bbcec92166b6fd 100644 --- a/frontend-js/src/test/js/map/surface/AliasSurface-test.js +++ b/frontend-js/src/test/js/map/surface/AliasSurface-test.js @@ -61,11 +61,30 @@ describe('AliasSurface', function () { var bounds = surface.getBounds(); surface.setBoundsForAlias(1, 3); var bounds2 = surface.getBounds(); - assert.equal(bounds.getRightBottom().y, bounds2.getRightBottom().y); + assert.equal(bounds.getRightBottom().y, bounds2.getRightBottom().y, helper.EPSILON); assert.ok(bounds.getRightBottom().x !== bounds2.getRightBottom().x); }); }); + it("before alias init", function () { + var map; + var alias, surface; + return ServerConnector.getProject().then(function (project) { + map = helper.createCustomMap(project); + return map.getModel().getAliasById(329171); + }).then(function (result) { + alias = result; + surface = new AliasSurface({ + alias: result, + overlayData: [helper.createLayoutAlias(alias)], + map: map + }); + surface.setBoundsForAlias(1, 3); + var bounds = surface.getBounds(); + assert.ok(bounds); + }); + }); + it("from element with data overlay", function () { var map = helper.createCustomMap(); var alias = helper.createAlias(map);