I would like to show a pop-up while executing code in a control, but the pop-up only appears at the end of the execution (so when control is handed over to the map again?) In Firefox, this works as expected, but not in Chrome or Edge.
Code:
rg.regioPrint = function(opt_options) {
this.options = options;
var element = document.createElement('div');
element.className = 'ol-unselectable ol-control rg-control-button';
var button = document.createElement('button');
element.appendChild(button);
var this_ = this;
button.onclick = function(e) {
this_.doPrint();
};
ol.control.Control.call(this, { element: element });
};
ol_inherits(rg.regioPrint, ol.control.Control);
rg.regioPrint.prototype.doPrint = function() {
// options.busyControl is a control that is added to the map earlier
// with map.addControl(ctl = new ....) and is working perfectly fine when
// called in other circumstances
this.options.busyControl.show();
// do some lengthy stuff
};
The pop-up only appears at the end of the 'lengthy stuff'. However, in FF, it works! Can I achieve this in another, maybe better way for Chrome/Edge? Thanks for your help. Linde