<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br>Yes, the moveend is triggered on every pan but it's not moving the popup.<br><br>The popup.moveto is always being called.<br><br>Any idea ?<br><br>> Date: Thu, 16 Jul 2009 09:45:34 -0400<br>> From: adube@mapgears.com<br>> To: kwonghu@hotmail.com<br>> CC: users@openlayers.org<br>> Subject: Re: [OpenLayers-Users] Popup in Openlayers (How to fix the popup?)<br>> <br>> Hi,<br>> <br>> Could you share more of your code, please ? How do you register you <br>> event for instance ? The 'moveend' event should be triggered on every pan.<br>> <br>> Regards,<br>> <br>> Alexandre<br>> <br>> Kwong Hu Kiu wrote:<br>> ><br>> ><br>> > I have tried that.<br>> ><br>> > Something like<br>> ><br>> > if (popup != null)<br>> > {<br>> > <br>> > var widthPixel = map.getSize().w - 280;<br>> > var heightPixel = map.getSize().h - 300;<br>> > popup.moveTo(new OpenLayers.Pixel(widthPixel, <br>> > heightPixel));<br>> > }<br>> ><br>> > But the popup does not want to move when i pan.<br>> > It only move if i zoom in/out.<br>> > I have debug'ed this and "pop.moveTo" is being called whenever i pan.<br>> ><br>> > Not really sure if this is a bug.<br>> ><br>> > I just want a simple popup that always appear on the lower right corner<br>> > so user can interact with the map.<br>> ><br>> > Regards.<br>> ><br>> ><br>> > > Date: Thu, 16 Jul 2009 08:18:27 -0400<br>> > > From: adube@mapgears.com<br>> > > To: kwonghu@hotmail.com<br>> > > CC: users@openlayers.org<br>> > > Subject: Re: [OpenLayers-Users] Popup in Openlayers (How to fix the <br>> > popup?)<br>> > ><br>> > > Hi,<br>> > ><br>> > > You could register a map 'moveend' event to move the popup again to<br>> > > the original location. You would need to recalculate the position on<br>> > > each move.<br>> > ><br>> > > Regards,<br>> > ><br>> > > Alexandre<br>> > ><br>> > > Kwong Hu Kiu wrote:<br>> > > > Hi,<br>> > > ><br>> > > > I am trying to use the openlayers popup in the map as below.<br>> > > ><br>> > > > if (this.popup == null)<br>> > > > {<br>> > > > this.popup = new OpenLayers.Popup();<br>> > > > this.popup.setBorder("2px solid");<br>> > > > this.popup.setSize(new OpenLayers.Size(270, 270));<br>> > > > this.popup.setContentHTML(popupContentHTML);<br>> > > > this.popup.setOpacity(0.65);<br>> > > > this.popup.addCloseBox();<br>> > > > map.addPopup(this.popup);<br>> > > > this.popup.show();<br>> > > > }<br>> > > > else<br>> > > > {<br>> > > > this.popup.setContentHTML(popupContentHTML);<br>> > > > this.popup.toggle();<br>> > > > }<br>> > > ><br>> > > ><br>> > > > How do i get it to display in one position (like the lower left<br>> > > > portion of the screen) ? and always appear there whenever you pan/zoom<br>> > > ><br>> > > > I figured that i can use popup.moveTo as below.<br>> > > ><br>> > > > var widthPixel = map.getSize().w - 280;<br>> > > > var heightPixel = map.getSize().h - 300;<br>> > > > this.popup.moveTo(new OpenLayers.Pixel(widthPixel, heightPixel));<br>> > > ><br>> > > > But the popup will move out of that location whenever you pan. It's<br>> > > > alright when you zoom in/out(always at the lower left) but not pan.<br>> > > ><br>> > > > Please help. Simple problem taking me a while to resolve.<br>> > > ><br>> > > > Cheers.<br>> > > ><br>> > > ><br>> > > > <br>> > ------------------------------------------------------------------------<br>> > > ><br>> > > > _______________________________________________<br>> > > > Users mailing list<br>> > > > Users@openlayers.org<br>> > > > http://openlayers.org/mailman/listinfo/users<br>> > > ><br>> > ><br>> > ><br>> > > --<br>> > > Alexandre Dubé<br>> > > Mapgears<br>> > > www.mapgears.com<br>> > ><br>> <br>> <br>> -- <br>> Alexandre Dubé<br>> Mapgears<br>> www.mapgears.com<br>> <br></body>
</html>