Commit 1dfed993 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

removing data overlay works properly

parent bcb204a8
......@@ -711,6 +711,7 @@ OverlayPanel.prototype.removeOverlay = function (overlay) {
return self.getMap().hideDataOverlay(overlay.getId()).then(function () {
return self.getServerConnector().removeOverlay({overlayId: overlay.getId()});
}).then(function () {
self.getProject().removeDataOverlay(overlay);
return self.refresh();
})
};
......
......@@ -456,6 +456,19 @@ Project.prototype.addDataOverlay = function (overlay, updateWhenExists) {
}
};
/**
*
* @param {DataOverlay} overlay
*/
Project.prototype.removeDataOverlay = function (overlay) {
var object = this._dataOverlays[overlay.getId()];
if (object === undefined) {
throw new Error("Overlay " + overlay.getId() + " doesn't exist in a project " + this.getProjectId());
} else {
delete this._dataOverlays[overlay.getId()];
}
};
/**
*
* @param {DataOverlay} overlay
......
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