I have a map onto which I place an empty div using map.AddControl() with the innerHTML="" like this:
function CreateBusy() {
divBusyPanel = document.createElement("div");
divBusyPanel.id = "divBusy";
divBusyPanel.style.top = "75px";
divBusyPanel.style.left = "75px";
divBusyPanel.style.width = "400px";
divBusyPanel.style.border = "1px solid black";
divBusyPanel.style.background = "white"; //"#DCDCDC";
divBusyPanel.style.fontFamily = "verdana roman";
divBusyPanel.style.fontSize = "8pt";
divBusyPanel.style.fontWeight = "bold";
divBusyPanel.innerHTML = "";
map.AddControl(divBusyPanel);
}
The contents of this div then dynamically updated at various points in my application by setting the innerHTML to some value using the ShowBusy method below:
function ShowBusy(title, msg) {
if (divBusyPanel == null)
CreateBusy();
divBusyPanel.innerHTML =
"<div>" +
"<table width='100%' border='0' cellpadding='0' cellspacing='0'>" +
"<tr bgcolor='#f0f0ff'><td " + maptitlestyle+ "><center><b>" + title + "</b></center></td></tr>" +
"</table>" +
"<br/><center>" +msg+ "</center><br/>";
"</div>";
}
The issue that i'm having is that when the ShowBusy("xxx","yyy") is called at various places in my application, the div is not updated immediatly. Do I need to call a method to tell the map to update or refresh any controls it is displaying?
I did have some success by adding setTimeout at various places in my code after the ShowBusy method is called but there must be a cleaner way to do it.
cheers
sanjay