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

Merge branch '273-overlays-in-submaps' into 'devel_11.0.x'

when opening a window that was already opened, overlays are not repainted (so…

See merge request piotr.gawron/minerva!183
parents 6192cdc8 47117868
......@@ -389,22 +389,22 @@ CustomMap.prototype.openSubmap = function (id) {
// we have to perform it on top map, because on submaps id is different
return this.openDataOverlay(self.getGoogleMap().getMapTypeId()).then(function () {
// now we have to visualize layouts
var layouts = [];
if (!wasInitialized) {
// now we have to visualize layouts
var layouts = [];
// get list of layouts
for (var key in self._selectedOverlays) {
if (self._selectedOverlays.hasOwnProperty(key) && self._selectedOverlays[key] === true) {
layouts.push(key);
// get list of layouts
for (var key in self._selectedOverlays) {
if (self._selectedOverlays.hasOwnProperty(key) && self._selectedOverlays[key] === true) {
layouts.push(key);
}
}
}
// show layouts that should be visualized (resize or show them)
for (var i = 0; i < layouts.length; i++) {
var layoutId = layouts[i];
submap._showSelectedLayout(layoutId, i, layouts.length);
}
if (!wasInitialized) {
// show layouts that should be visualized (resize or show them)
for (var i = 0; i < layouts.length; i++) {
var layoutId = layouts[i];
submap._showSelectedLayout(layoutId, i, layouts.length);
}
return self.refreshMarkers(true);
}
});
......
......@@ -189,6 +189,28 @@ describe('CustomMap', function() {
});
});
it("with submap double opened", function () {
var projectId = "complex_model_with_submaps";
helper.setUrl("http://test/?id=" + projectId);
var customMap, filledSubmap ;
var filledSubmodelId = 16731;
var overlayId = 18083;
return ServerConnector.getProject(projectId).then(function (project) {
customMap = helper.createCustomMap(project);
return customMap.openSubmap(filledSubmodelId);
}).then(function () {
filledSubmap = customMap.getSubmapById(filledSubmodelId);
return customMap.openDataOverlay(overlayId);
}).then(function () {
assert.equal(1, filledSubmap.selectedLayoutOverlays[overlayId].length);
return customMap.openSubmap(filledSubmodelId);
}).then(function () {
//after opening submap nothing should change
assert.equal(1, filledSubmap.selectedLayoutOverlays[overlayId].length);
});
});
});
it("removeSelectedLayout", function() {
......
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