[Users] Popup Window Anchor
Dan Ramage
dan at inlet.geol.sc.edu
Fri Nov 13 19:48:00 CET 2009
I actually have something up and running now, however I've discovered a bug
here or there. I'd be happy to share whatever I come up with.
I'm no CSS wiz so I was worrying I was developing something that could be
easily handled with CSS magic.
Dan
_____
From: sbenthall.work at gmail.com [mailto:sbenthall.work at gmail.com] On Behalf
Of Sebastian Benthall
Sent: Friday, November 13, 2009 11:43 AM
To: Dan Ramage
Cc: Users at geoext.org
Subject: Re: [Users] Popup Window Anchor
Hi Dan,
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.
This is actually a long-standing issue in GeoExt that is as old as the
popups themselves:
http://trac.geoext.org/ticket/5
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.
On Thu, Nov 12, 2009 at 12:36 PM, Dan Ramage <dan at inlet.geol.sc.edu> wrote:
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:
var anc = this.anc;
var dx = anc.getLeft(true) + anc.getWidth() / 2;
var dy = this.el.getHeight();
dy is taking into account the height of the new topanchor.png.
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:
.gx-popup-anctop{
background:transparent url(../images/default/topanchor.png) no-repeat 0 0;
position:relative;
top:-1px;
left:5px;
z-index:2;
height:16px;
width:31px;}
In the code, I will determine which anchor needs to be displayed and remove
the other one.
I appreciate any pointers!
Dan
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
--
Sebastian Benthall
OpenGeo - http://opengeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20091113/6e577e4a/attachment-0001.htm
More information about the Users
mailing list