Commit a845b080 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '830-async-data-overlay-init-might-cause-problems' into 'devel_13.1.x'

Resolve "MINERVANET - Error Report 74"

See merge request minerva/core!804
parents e1aed7d7 f2782289
......@@ -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
......
......@@ -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);
}
};
/**
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment