[OpenLayers-Users] Re: Move OpenLayers.Popup.FramedCloud up to 10 pixel...

teknocreator teknocreator at gmail.com
Wed Mar 28 18:42:30 EDT 2012


Paul,

A possible solution:

var pix = new OpenLayers.Pixel();
pix = feature.geometry.getBounds().getCenterPixel();  // assuming you can
access feature
var newpix = new OpenLayers.Pixel();
newpix = pix.add(0,-10);  // newpix = pix.x and pix.y-10, where y decreases
going up;

popup = new OpenLayers.Popup.FramedCloud("popupSelect",
                        map.getLonLatFromPixel(newpix),    // assuming map
is global
                        new OpenLayers.Size(100, 100),
                        "popup xx contents<br>TEST TEST <br> *
asdsadsadasdas*",
                        null, true, onPopupClose);

There may be an easier way than this, though.  I've tested it as if I was
clicking on a point where the popup should appear and the popup was offset
by the values I entered.  Hope it works for the
feature.geometry.getBounds().getCenterPixel() as well.

Dave M

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Move-OpenLayers-Popup-FramedCloud-up-to-10-pixel-tp4661702p4666003.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list