Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to create GeoExt action button to fetch the feature info from all the layers. I am still getting the info for my point features but I am getting nothing for the usa:states, that appears in the geoserver by default.

When I looked into the firebug, the html for states does not have anything in it's , http://dpaste.de/NLjzW/. But the species data that I am adding has the contents in the , http://dpaste.de/XR3Ou/. The contents in the body are the result of passing evt.text param, which is assigned to the html: evt.text in my addToPopup() function.

Why is this happening?

Update:

I am sorry i forgot to add the addToPopup() function before.

I thought that maybe there was no data in the usa:states layer, but it does have the data. If you click on the polygon in this app,

http://128.196.142.12:8080/geoserver/usa/wms?service=WMS&version=1.1.0&request=GetMap&layers=usa:states&styles=&bbox=-124.731,24.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=application/openlayers

You can see the data in the polygon.

share|improve this question
    
Can you add the relevant sections of your code to this post, please? That may help in diagnosis of the problem. –  user3461 Aug 31 '12 at 18:36
1  
sorry about that @Kevin, I have updated the question. –  Sam007 Aug 31 '12 at 18:47

1 Answer 1

up vote 0 down vote accepted

It is because yor WMS layers have different URLs and your WMSGetFeatureInfo control doesn't listen any layers event except "pima". Try to configure WMSGetFeatureInfo control the following way:

new OpenLayers.Control.WMSGetFeatureInfo({
    drillDown: true,
    autoActivate: true,
    infoFormat: "application/vnd.ogc.gml",
    queryVisible: true,
    ...
share|improve this answer
    
Ok now I am not getting the pima features. http://128.196.142.12/geo/test/test_new.html. The states is working fine. Here is my code, dpaste.de/hIbje –  Sam007 Sep 4 '12 at 18:33
    
Oh it seems that if I switch off the USA layer, then I can view the Pima features. Also, once I switch off the USA states layer and then turn it on again, the tool does not collect the states features and the features are empty –  Sam007 Sep 7 '12 at 16:28
    
sorry to bother you again, but pls help? –  Sam007 Sep 13 '12 at 19:26
    
@Sam007, I've modified my answer, please check it out. I've tested this solution and it works fine - both pima and states layers are queryable. –  drnextgis Sep 14 '12 at 10:27
    
Thanks a lot that works –  Sam007 Sep 17 '12 at 16:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.