[OpenLayers-Users] Popups that follow the mousepointer

Trond Michelsen trondmm-openlayers at crusaders.no
Mon Nov 17 11:54:47 EST 2008


On Mon, Nov 17, 2008 at 10:31:40AM -0500, Amos Hayes wrote:
> Hello Trond. I was having the same problem and tried to write around  
> it by moving the popup corner a number of pixels horizontally and  
> vertically to avoid covering the point. Unfortunately, my algorithm  
> for guessing which quadrant the popup will appear in is flawed for  
> points near the very center of the map. If you can fix it or find a  
> better way (I have yet to feel capable enough to explore the  
> OpenLayers popup code), I'd love to see it. :)

Thanks for the example. Unfortunately it didn't quite work for my
case. I forgot to mention that the layer I'm using SelectFeature on is
a polygon layer, so the mousepointer could be quite far from the
center of the polygon.

It occured to me, though, that I could just set the position to a few
pixels off the mouseposition instead. However, I'm unable to find the
event-object that would have the .xy-property with the mouseposition
within the SelectFeature-object.

-- 
  // Trond Michelsen
\X/  mike at crusaders.no



More information about the Users mailing list