<font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">anyone interested in the solution of this problem:<br>moveTo use layerPx info instead of </font></font></font><font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">ViewPortPx so<br>
<br></font></font></font><font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif"></font></font></font><font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">  pos = map.getLayerPxFromViewPortPx(map.getViewPortPxFromLonLat(pos));<br>
</font></font></font><font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif"><br>solved the problem!<br><br><br>-Vito-<br><br><br><br clear="all"></font></font></font>--<br>-----------<br>Tafuni Vito<br>
<a href="mailto:vito@vitotafuni.com">vito@vitotafuni.com</a><br>---------------------------------------------<br>"Verba volant, scripta manent... data corrupted"<br>
<br><br><div class="gmail_quote">2010/6/21 Vito Tafuni <span dir="ltr"><<a href="mailto:vitotafuni@gmail.com">vitotafuni@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">i'm playing with the drag control and i would like to display the feature position while dragging<br><br>onDrag: function(feature, pixel){<br>
<br>
                    var pos = feature.geometry.getBounds().getCenterLonLat();<br>                    <br>                    if(!feature.coordPopup){<br>                        var coordPopup = new OpenLayers.Popup.Anchored("coords",pos,null,"", {<br>
                            offset: new OpenLayers.Pixel(0,20),<br>                            size: new OpenLayers.Size(0,0)    <br>                        });<br>                           coordPopup.calculateRelativePosition = function(){return "tr";}<br>
                           <br>                           feature.coordPopup = coordPopup;<br>                        map.addPopup(feature.coordPopup);<br>                    };<br><br><br>                    pos = map.getViewPortPxFromLonLat(pos);<br>
                    feature.coordPopup.setContentHTML(pos);<br>                    feature.coordPopup.updateSize();<br>                                        <br><br>                    feature.coordPopup.moveTo(pos);<br>
                },<br>                upFeature: function(pixel){<br>                           map.removePopup(this.feature.coordPopup);<br>                        this.feature.coordPopup.destroy();<br>                        this.feature.coordPopup = null;<br>
                }<br><br></font></font></font><font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">everything is ok <br>popup moves as the feature is dragged and shows the current position<br>BUT when i pan the map the popup is drawn at different position even if the viewportpx is the same<br>
<br>for example<br>before pan: popup at 100,100<br>after pan: same position (popup display 100,100) but popup is drawn at 150,70<br><br>what i'm doing wrong??<br><br><br>Vito<br><br><br><br><br><br clear="all"></font></font></font>--<br>
-----------<br>Tafuni Vito<br><a href="mailto:vito@vitotafuni.com" target="_blank">vito@vitotafuni.com</a><br>---------------------------------------------<br>"Verba volant, scripta manent... data corrupted"<br>
</blockquote></div><br>