Infrastructure Map Server Developer

Infrastructure Map Server Developer

Reply
Active Member
swati
Posts: 6
Registered: ‎05-23-2003
Message 1 of 6 (43 Views)

javascript message box (interesting problem)

43 Views, 5 Replies
10-01-2002 07:39 AM
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");
}
*Snapple
Message 2 of 6 (43 Views)

javascript message box (interesting problem)

10-01-2002 10:01 AM in reply to: swati
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");

}

*swati
Message 3 of 6 (43 Views)

javascript message box (interesting problem)

10-02-2002 02:34 AM in reply to: swati


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");

}



Active Member
swati
Posts: 6
Registered: ‎05-23-2003
Message 4 of 6 (43 Views)

Re: javascript message box (interesting problem)

10-02-2002 02:41 AM in reply to: swati
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
Message 5 of 6 (43 Views)

javascript message box (interesting problem)

10-02-2002 09:56 AM in reply to: swati
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

Active Member
sachin_gis
Posts: 7
Registered: ‎03-16-2006
Message 6 of 6 (43 Views)

Re: javascript message box (interesting problem)

03-17-2006 02:09 AM in reply to: swati
Hi swati I am facing the same problem in javascript?
If you have solved it please do tell me.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.