Hi Steven,<br><br>Thanks for the help, it now works :-)<br><br>Cheers,<br><br>Andy<br><br><div><span class="gmail_quote">On 11/03/2008, <b class="gmail_sendername">Stephen Woodbridge</b> &lt;<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Andy Dale wrote:<br> &gt; Hi,<br> &gt;<br> &gt; I have an extracted all the javascript that is used for displaying the<br> &gt; map into a separate .js file.&nbsp;&nbsp;This works very well, the only problem<br> &gt; being that, I cannot figure out how to set the mouseposition control to<br>
 &gt; be in a separate div.&nbsp;&nbsp;I initialize the control like so:<br> &gt;<br> &gt; map.addControl(new OpenLayers.Control.MousePosition({element: $(&#39;mydiv&#39;)}));<br> &gt;<br> &gt; where mydiv will exist on every page i use the map on.&nbsp;&nbsp;As an experiment<br>
 &gt; i include all the JavaScript contained within the external javascript in<br> &gt; head section, and the MousePosition is displayed in the correct div.<br> &gt;<br> &gt; Is there a way to set the div for the mouse position if you are<br>
 &gt; including the javascript to display the map as an external file ??<br> <br> <br>Andy,<br> <br> Create an initialize function that executes your map initialization and<br> put the in your external file. Then<br> <br>
 &lt;body onLoad=myInitialize()&gt;<br> <br> The problem you are having in that &#39;mydiv&#39; has not been created in the<br> DOM yet when you execute the map.addControl... command above, but it<br> will be when the onLoad event is fired.<br>
 <br> -Steve W<br>&nbsp;&nbsp;<a href="http://imaptools.com/">http://imaptools.com/</a><br> </blockquote></div><br>