<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br>Anyone has any ideas about the source code i attached ?<br><br>I want to fix it as i have spent quite some time on it.<br><br>Thanks.<br><br><hr id="stopSpelling">From: kwonghu@hotmail.com<br>To: adube@mapgears.com; users@openlayers.org<br>Date: Fri, 17 Jul 2009 01:49:45 +0800<br>Subject: Re: [OpenLayers-Users] Popup in Openlayers (How to fix the popup?)<br><br>



<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>


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



    <title>ENC Charts</title>
    
    <style>
.ExternalClass
{;}
.ExternalClass #EC_map
{width:100%;height:100%;}
</style>

    
    



    <div id="map">
    </div></body>
</html>