[Users] Cannot get feature info to work with layers loaded from getcapabilities doc.

Christian Mayer mayer at terrestris.de
Thu Jan 20 10:44:20 CET 2011


Hello,

I am not sure if this solves your problem, but first of all you should 
use *location: e.xy* instead of *lonlat: 
mapPanel.map.getLonLatFromPixel(e.xy)* (since version 1.0).

What I think could be a problem is the fact that you have provided no 
URL to your WMSGetFeatureInfo Control. Have a look at

http://openlayers.org/dev/examples/getfeatureinfo-control.html

Best regards,
Chris


Am 18.01.2011 19:32, schrieb Robert Buckley:
>     Hi,
>
> I have layers in a mapPanel which can be queried without problem.
>
> I also have a getcapabilities window which loads layers into the map. 
> But these layers do not get a response from the getFeatureInfo method.
>
>
> Could anyone offer any suggestion as to why this doesn´t happen?
>
> yours,
>
> Robert
>
> CODE FOR THE POPUPS
>
> // create the popup
> var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
>     queryVisible: true,
>     highlightOnly: false,
>     maxFeatures: 2,
>
> });
>
>
> featureInfo.events.on({
>     getfeatureinfo: function(e) {
>         new GeoExt.Popup({
>             title: "INFO",
>             width: 300,
>             height : 200,
>             autoHeight: true,
>             layout: 'fit',
>             bodyStyle: 'background-color:#FFF;,font-size:14px;',
>             autoScroll: true,
>             maximizable: true,
>             map: mapPanel.map,
>             lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
>             html: e.text,
>             unpinnable:true,
>             anchored: true,
>             shadow: true,
>             listeners: {
>                     close: function() {
>                         // closing a popup destroys it, but our 
> reference is truthy
>                         popup = null;
>                     }
>                 }
>
>         }).show();
>     }
> });
>
> map.addControl(featureInfo);
> featureInfo.activate();
>
>
>
>
>
> _______________________________________________
> 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/20110120/ac22c06a/attachment.htm 


More information about the Users mailing list