Hi Dan,<br><br>I'm afraid I don't have any big ideas on this, but if you posted some code up it might be easier to see what you're talking about.<br><br>This is actually a long-standing issue in GeoExt that is as old as the popups themselves:<br>
<a href="http://trac.geoext.org/ticket/5">http://trac.geoext.org/ticket/5</a><br><br>If you were working on a generic solution or were interested in collaborating on one, I would recommend getting a GeoExt sandbox and developing the solution there. I, for one, would be interested in working on this with you.<br>
<br><div class="gmail_quote">On Thu, Nov 12, 2009 at 12:36 PM, Dan Ramage <span dir="ltr"><<a href="mailto:dan@inlet.geol.sc.edu">dan@inlet.geol.sc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Greetings GeoExters, I am working on a restricted extents
map and because of this, I’ve had to modify the behavior of the
GeoExt.Popup(). The current popup always tries to position itself above the
clicked on feature, and this will work if it is allowed to scroll the map.
However with my map, it can’t do this, so it is possible that part of the
popup will basically go through the top of the screen or off the right side, or
even through the bottom. I’ve coded up a new position function that
correctly positions the popup so this doesn’t happen. I am currently
working on moving the anchor image as well, and have it correctly moving to the
right side of the popup if the popup must be shifted left. What I am scratching
my head on is if I need to position the popup under the feature, I need the
anchor on top of the popup. Now, I’ve got a rotated anchor
image(topanchor.png) and I’ve add a new style into the popup.css. I’ve
also overloaded the base onRender and initComponent functions from the
GeoExt.Popup() to add the new anchor. When the popup gets loaded now, I’ve
got the normal downward pointing anchor as well as the upward pointed anchor.
The upward pointing anchor is positioned under the downward pointing anchor. This
is causing the code to calculate the height of the popup to be off as well:</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">var anc = this.anc;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">var dx = anc.getLeft(true) + anc.getWidth() / 2;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">var dy = this.el.getHeight();</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">dy is taking into account the height of the new
topanchor.png.</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I am not sure how to initially position the upward pointing
anchor to be on top of the popup. My thought is the entry in the popup.css file
is what I need to change, but I am not 100% sure. The current entry I have is:</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">.gx-popup-anctop{</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">background:transparent url(../images/default/topanchor.png)
no-repeat 0 0;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">position:relative;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">top:-1px;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">left:5px;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">z-index:2;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">height:16px;</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">width:31px;}</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">In the code, I will determine which anchor needs to be displayed
and remove the other one. </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I appreciate any pointers!</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p><font color="#888888">
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Dan</span></font></p>
</font></div>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Sebastian Benthall<br>OpenGeo - <a href="http://opengeo.org">http://opengeo.org</a><br><br>