<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><P>Hello mapguide users, </P><P></P><P>I've been reading the DWF viewer API and still didn't find a solution of how to find out when a map has loaded using the DWF viewer. For the AJAX viewer it works like a charm.</P><P></P><P>Here is some sample code using the AJAX viewer :</P><P></P><P>In the first page I have :</P><P></P><P>&lt;%@include file="utilityfunctionsMapguide.jsp" %&gt;<BR><BR>&lt;%<BR>    /* Initialize a JSP session and register a variable to hold the session id,<BR>    then initialize the Web Extensions, and connect to the site, and create a session. */<BR><BR>    try {<BR>        createSessionMapguide(request);<BR>    } catch (Throwable t) {<BR>        response.sendRedirect("errorPageMapguide.jsp?ERROR=" + t.getMessage());<BR>    }<BR><BR>%&gt;<BR><BR>&lt;html&gt;<BR><BR>&lt;head&gt;<BR>    &lt;script type="text/javascript"&gt;<BR>    
    var timeout;<BR>        function executeActions() {<BR>            if (document.getElementById("viewerFrame").readyState == "complete") {<BR>                clearTimeout(timeout);<BR>                var tempWin = window.open('ajaxviewerMapguideScriptFrame.jsp?SESSION=&lt;%=sessionId%&gt;&amp;WEBLAYOUT=&lt;%=webLayout%&gt;&amp;GUID=&lt;%=GUID%&gt;', 'scriptFrame', '');<BR>            } else {<BR>                timeout = setTimeout("executeActions()", 500);<BR>            }<BR>        }<BR>    &lt;/script&gt;<BR>&lt;/head&gt;<BR><BR>&lt;body marginheight="0" marginwidth="0" onload=" &lt;%<BR>                                                    if (GUID != null) {%&gt;<BR>                                                        executeActions()<BR>                                                    &lt;%}%&gt;"&gt;<BR><BR>&lt;iframe id="viewerFrame" name="ify" width="100%" height="100%" frameborder=0 scrolling="no"<BR>       
 src="/mapguide/mapviewerajax/?SESSION=&lt;%=sessionId%&gt;&amp;WEBLAYOUT=&lt;%=webLayout%&gt;"/&gt;<BR><BR><BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR><BR>As you can see here when the iframe has loaded I open a new jsp page &lt;ajaxviewerMapguideScriptFrame.jsp&gt; where I test if the map has loaded</P><P></P><P>The &lt;ajaxviewerMapguideScriptFrame.jsp&gt; page has the following content:</P><P></P><P>&lt;html&gt;<BR>&lt;head&gt;<BR>    &lt;%<BR>        String sessionId = request.getParameter("SESSION");<BR>        String webLayout = request.getParameter("WEBLAYOUT");<BR>        String GUID = request.getParameter("GUID");<BR>    %&gt;<BR>    &lt;script type="text/javascript"&gt;<BR>        var t;<BR>        function onPageLoad() {<BR>            if (parent.mapFrame.mapInit) {<BR>                clearTimeout(t);<BR>               
 window.open('ajaxviewerMapguideJS.jsp?SESSION=&lt;%=sessionId%&gt;&amp;WEBLAYOUT=&lt;%=webLayout%&gt;&amp;GUID=&lt;%=GUID%&gt;', 'scriptFrame', '');<BR>            } else {<BR>                t = setTimeout("onPageLoad()", 500);<BR>            }<BR><BR>        }<BR>    &lt;/script&gt;<BR>&lt;/head&gt;<BR><BR>&lt;body onload="onPageLoad()"&gt;<BR><BR>&lt;/body&gt;<BR><BR>&lt;/html&gt;<BR> </P><P>From what I have read from the DWF API I have to use something like this</P><P></P><P>&lt;object id="ADViewer" <BR>         classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" <BR>         border="1" width="400" height="400" VIEWASTEXT&gt;<BR>         &lt;param name="Src" <BR>                 value="http://download.autodesk.com/global/dwf/gallery/files/085825-1-zobell_residence.dwf"&gt;<BR>         &lt;/object&gt;<BR></P><P></P><P>and this</P><P></P><P>&lt;script type="text/javascript" for="ADViewer" event="OnEndLoadItem(bstrItemType,vData,vResult)"&gt;<BR> <BR>  if (bstrItemType ==
 'DOCUMENT')<BR>  {<BR> //Indicates the document is finished loading<BR> ListSections();<BR>  }<BR> <BR> &lt;/script&gt;<BR><BR>ok, but how do I implement this into my code, where should I put it, because I have an iframe tag that uses a webLayout not a dwf file  ?</P><P><BR> <BR><BR></P></td></tr></table><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com