Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

javascript message box (interesting problem)

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
254 Views, 5 Replies

javascript message box (interesting problem)

I seem to have coded myself into a silly situation. I have a function in javascript working exactly as I want, but for a unneeded alert box!
I added a message box for troubleshooting and now have the function working the way I want it to.
BUt now, if I remove the message box, the function does not seem to work.It seems like th user input of OK on the message box triggers the function to continue.( would that be possible?)
How do I get out of this? Please help.

function zoomFeature( ){
var map = getMap();
map.setAutoRefresh(false);
numRows = GetName.getRowCount();
for (i=0;i var templat = GetName.getField(i,"lat");
var templon = GetName.getField(i,"lon");
var tempfacil = GetName.getField(i,"faciid");
}

//alert(" done setting variables"); //I WANT TO REMOVE THIS MESSAGE BOX

if (tempfacil == "campus") {
map.zoomScale(templat,templon,10000);
}
else {
map.zoomScale(templat,templon,800);
}
self.focus();
map.setAutoRefresh(true);
map.refresh();
//alert("done");
}
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Hi Swati

 

Please check the ismapbusy section to solve your
problem.

Your alert message indirectly "solved" the
ismapbusy problem that is why it is work when your alert box is
there.

 

Take alook at API help under section mapbusy. 
It explain and give some example on how to do it

 

Hopefully it works

Regards

snapple


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
seem to have coded myself into a silly situation. I have a function in
javascript working exactly as I want, but for a unneeded alert box!
I
added a message box for troubleshooting and now have the function working the
way I want it to.
BUt now, if I remove the message box, the function does
not seem to work.It seems like th user input of OK on the message box triggers
the function to continue.( would that be possible?)
How do I get out of
this? Please help.

function zoomFeature( ){
var map = getMap();

map.setAutoRefresh(false);
numRows = GetName.getRowCount();
for
(i=0;i<numRows;i++){
var templat = GetName.getField(i,"lat");
var
templon = GetName.getField(i,"lon");
var tempfacil =
GetName.getField(i,"faciid");
}

//alert(" done setting variables"); //I WANT TO REMOVE THIS MESSAGE BOX

if (tempfacil == "campus") {

 map.zoomScale(templat,templon,10000);
 }
 else {

 map.zoomScale(templat,templon,800);
 }
self.focus();

map.setAutoRefresh(true);
map.refresh();
//alert("done");

}

Message 3 of 6
Anonymous
in reply to: Anonymous



thanks for your message.I tried what you said and I do agree the map is
busy when I try to run the funcion. Now how do I wait for it to get out
of that state and try again?

is'nt my setautorefresh to false taking care of it?

Thanks a lot

swati

 

Snapple wrote:

 Hi Swati Please
check the ismapbusy section to solve your problem.
Your
alert message indirectly "solved" the ismapbusy problem that is why it
is work when your alert box is there.
 Take
alook at API help under section mapbusy.  It explain and give some
example on how to do it
 Hopefully
it works
Regardssnapple

style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">"swati"
<swatip@stanford.edu> wrote
in message news:f1140c9.-1@WebX.maYIadrTaRb...I
seem to have coded myself into a silly situation. I have a function in
javascript working exactly as I want, but for a unneeded alert box!

I added a message box for troubleshooting and now have the function
working the way I want it to.

BUt now, if I remove the message box, the function does not seem to
work.It seems like th user input of OK on the message box triggers the
function to continue.( would that be possible?)

How do I get out of this? Please help.

function zoomFeature( ){

var map = getMap();

map.setAutoRefresh(false);

numRows = GetName.getRowCount();

for (i=0;i<numRows;i++){

var templat = GetName.getField(i,"lat");

var templon = GetName.getField(i,"lon");

var tempfacil = GetName.getField(i,"faciid");

}

//alert(" done setting variables"); //I WANT TO REMOVE THIS MESSAGE
BOX

if (tempfacil == "campus") {

 map.zoomScale(templat,templon,10000);

 }

 else {

 map.zoomScale(templat,templon,800);

 }

self.focus();

map.setAutoRefresh(true);

map.refresh();

//alert("done");

}



Message 4 of 6
Anonymous
in reply to: Anonymous

thanks for your message.I tried what you said and I do agree the map is busy when I
try to run the funcion. Now how do I wait for it to get out of that state and try again?
is'nt my setautorefresh to false taking care of it?

Thanks a lot
swati
Message 5 of 6
Anonymous
in reply to: Anonymous

well setAutorefresh not necessary taking care of it

when you chech using isMapBusy put condition if yes
to call the function you want again but better if you use timer

Meaning,

 

function hello()

{
   if (map.isBusy())
setTimeout("hello()", 1000);

    else

   --do something you want
here--

}

 

Regards

snapple


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
thanks
for your message.I tried what you said and I do agree the map is busy when I

try to run the funcion. Now how do I wait for it to get out of that state
and try again?
is'nt my setautorefresh to false taking care of it?

Thanks a lot
swati

Message 6 of 6
sachin_gis
in reply to: Anonymous

Hi swati I am facing the same problem in javascript?
If you have solved it please do tell me.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report