[Users] Problems with WMSGetFeatureInfo-Popup
IT Intern
itintern12 at gmail.com
Fri Jan 14 16:18:26 CET 2011
Funny, it only works for me if I use both:
location: new
OpenLayers.LonLat(mapPanel.map.getLonLatFromPixel(event.xy)).transform(new
OpenLayers.Projection("EPSG:4326"), new
OpenLayers.Projection("EPSG:900913")),
lonlat: mapPanel.map.getLonLatFromPixel(event.xy),
elshae
On Fri, Jan 14, 2011 at 8:48 AM, Andreas Hocevar <ahocevar at opengeo.org>wrote:
> Hi,
>
> you can even simplify this, because with r1.0, GeoExt.Popup has gotten
> smarter. Just use
>
> location: e.xy
>
> Regards,
> Andreas.
>
> On Jan 14, 2011, at 09:51 , Christian Mayer wrote:
>
> > Hello Kai,
> >
> > you should set the property "location" instead of "lonlat" in your popup:
> >
> > featureInfo.events.on({
> > getfeatureinfo: function(e) {
> > new GeoExt.Popup({
> > title: "Feature Info",
> > width: 200,
> > height: 150,
> > autoScroll: true,
> > maximizable: true,
> > map: mappanel.map,
> > location: mappanel.map.getLonLatFromPixel(e.xy),
> > html: e.text
> > }).show();
> > }
> > });
> >
> > Best regards,
> > Chris
> >
> >
> >
> > Am 13.01.2011 15:59, schrieb Kai Volland:
> >> Hello everybody,
> >>
> >> i tried to fetch some featureinfos from geoserver and display in a
> popup.
> >> I used this code:
> >>
> >> // GetFeatureInfo
> >>
> >> var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
> >> url: 'http://sfb806srv.uni-koeln.de:8080/geoserver/wms',
> >> layers:[pfeile],
> >> info_format:'text/plain',
> >> });
> >>
> >> featureInfo.events.on({
> >> getfeatureinfo: function(e) {
> >> new GeoExt.Popup({
> >> title: "Feature Info",
> >> width: 200,
> >> height: 150,
> >> autoScroll: true,
> >> maximizable: true,
> >> map: mappanel.map,
> >> lonlat: mappanel.map.getLonLatFromPixel(e.xy),
> >> html: e.text
> >> }).show();
> >> }
> >> });
> >> mappanel.map.addControl(featureInfo);
> >> featureInfo.activate();
> >>
> >> A click on the map results in an empty popup and the following errors in
> Firebug:
> >>
> >> centerPx is null
> >> this.setPosition(centerPx.....x - dx, centerPx.y + mapBox.y - dy);
> Popup.js (Line 244)
> >>
> >> The GET-Request is also shown in red.
> >> Params and Header are ok i think. But Response and Html keep empty.
> >>
> >> I hope anyone can help me.
> >>
> >> Kind regards Kai
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> WEB.DE DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt mit
> >> gratis Handy-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2
> >>
> >> _______________________________________________
> >> Users mailing list
> >>
> >> Users at geoext.org
> >> http://www.geoext.org/cgi-bin/mailman/listinfo/users
> > _______________________________________________
> > Users mailing list
> > Users at geoext.org
> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110114/f67ad5e6/attachment.htm
More information about the Users
mailing list