<div>Good morning list,<br><br>I'm hoping someone who has used the GeoExt popup can help here. Still new to OpenLayers and just started to worke with GeoExt/ExtJS. I sucessfully created an OL Framed Cloud popup to open when the mouse is clicked on the map and display values returned from the server at that point. The popup first displays "Updating information..." to let the user know that the data is being retrieved and then displays it a bit later. The OL popup expands upward to accommodate the changed information. So, attempted the same thing using GeoExt popup following the example on the page with the popup-more.js code. I thought I adapted the code successfully and it appeared to work. However, after the data is retrieved, the anchor repositions down when the text in the popup is updated and is no longer positioned where the I clicked with the mouse. The strange thing is when I collapse the popup and expand it, it repositions again to where the I clicked with the mouse. And even stranger is that when I try to debug this using Firebug, it doesn't occur. Here's relevant code to create and maintain the popup, most taken from the GeoExt example code, popup-more.js:<br>
<br>// mouse click function for info popup<br><br> function addToPopup(loc) {<br><br> // create the popup if it doesn't exist<br> if (!popup) {<br> popup = new GeoExt.Popup({<br> title: "Popup",<br>
maximizable: true,<br> collapsible: true,<br> map: map,<br> anchored: true,<br> html: "Updating<br/>information...",<br> listeners: {<br>
close: function() {<br> // closing a popup destroys it, but our reference is truthy<br> popup = null;<br> }<br> }<br> });<br>
}<br> else {<br> popup.body.update("Updating<br/>information...");<br> }<br><br> // retrieve data at the point clicked<br><br> getPopupText(loc);</div>
<div> </div>
<div> // reset the popup's location<br><br> popup.location = loc;<br> <br> popup.doLayout();<br><br> // since the popup is anchored, calling show will move popup to this location<br> popup.show();<br>
}<br><br>The getPopupText(loc) function creates the html text for display in the popup after retrieving information from the server. Relevant part:<br><br> wincontent = "Station ID = " + locid + "<br/>" +<br>
"<NOBR>Station Name = " + locname + "</NOBR><br/>" + <br> "Latitude = " + loclat.toFixed(4) + "<br/>" +<br>
"Longitude = " + loclon.toFixed(4) + "<br/>" +<br> "Grid Value = " + locvalue.toFixed(2) + locunit; <br> <br> <br>
// set the popup text information with ExtJS<br><br> popup.body.update(wincontent);<br><br>Sorry, I don't have a public page to view. I saw a similar problem (if not the same) in the list archive in June 2010 when I searched for a solution to this problem: <a href="http://www.mail-archive.com/users@geoext.org/msg00297.html">http://www.mail-archive.com/users@geoext.org/msg00297.html</a>. However, I'm unsure whether the solution solves the problem in general. Not sure what setting I have to ensure is set properly in order for this not to happen. Like I said, it doesn't in the OL poup.</div>
<div> </div>
<div>Appreciate any help!</div>
<div> </div>
<div>Thanks</div>
<div> </div>
<div>Dave</div>