Funny, it only works for me if I use both:<br> location: new OpenLayers.LonLat(mapPanel.map.getLonLatFromPixel(event.xy)).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")),<br>
lonlat: mapPanel.map.getLonLatFromPixel(event.xy),<br><br>elshae<br><br><div class="gmail_quote">On Fri, Jan 14, 2011 at 8:48 AM, Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
you can even simplify this, because with r1.0, GeoExt.Popup has gotten smarter. Just use<br>
<br>
location: e.xy<br>
<br>
Regards,<br>
Andreas.<br>
<div><div></div><div class="h5"><br>
On Jan 14, 2011, at 09:51 , Christian Mayer wrote:<br>
<br>
> Hello Kai,<br>
><br>
> you should set the property "location" instead of "lonlat" in your popup:<br>
><br>
> featureInfo.events.on({<br>
> getfeatureinfo: function(e) {<br>
> new GeoExt.Popup({<br>
> title: "Feature Info",<br>
> width: 200,<br>
> height: 150,<br>
> autoScroll: true,<br>
> maximizable: true,<br>
> map: mappanel.map,<br>
> location: mappanel.map.getLonLatFromPixel(e.xy),<br>
> html: e.text<br>
> }).show();<br>
> }<br>
> });<br>
><br>
> Best regards,<br>
> Chris<br>
><br>
><br>
><br>
> Am 13.01.2011 15:59, schrieb Kai Volland:<br>
>> Hello everybody,<br>
>><br>
>> i tried to fetch some featureinfos from geoserver and display in a popup.<br>
>> I used this code:<br>
>><br>
>> // GetFeatureInfo<br>
>><br>
>> var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({<br>
>> url: '<a href="http://sfb806srv.uni-koeln.de:8080/geoserver/wms" target="_blank">http://sfb806srv.uni-koeln.de:8080/geoserver/wms</a>',<br>
>> layers:[pfeile],<br>
>> info_format:'text/plain',<br>
>> });<br>
>><br>
>> featureInfo.events.on({<br>
>> getfeatureinfo: function(e) {<br>
>> new GeoExt.Popup({<br>
>> title: "Feature Info",<br>
>> width: 200,<br>
>> height: 150,<br>
>> autoScroll: true,<br>
>> maximizable: true,<br>
>> map: mappanel.map,<br>
>> lonlat: mappanel.map.getLonLatFromPixel(e.xy),<br>
>> html: e.text<br>
>> }).show();<br>
>> }<br>
>> });<br>
>> mappanel.map.addControl(featureInfo);<br>
>> featureInfo.activate();<br>
>><br>
>> A click on the map results in an empty popup and the following errors in Firebug:<br>
>><br>
>> centerPx is null<br>
>> this.setPosition(centerPx.....x - dx, centerPx.y + mapBox.y - dy); Popup.js (Line 244)<br>
>><br>
>> The GET-Request is also shown in red.<br>
>> Params and Header are ok i think. But Response and Html keep empty.<br>
>><br>
>> I hope anyone can help me.<br>
>><br>
>> Kind regards Kai<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> <a href="http://WEB.DE" target="_blank">WEB.DE</a> DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt mit<br>
>> gratis Handy-Flat! <a href="http://produkte.web.de/go/DSL_Doppel_Flatrate/2" target="_blank">http://produkte.web.de/go/DSL_Doppel_Flatrate/2</a><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>><br>
>> <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
>> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>