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