0

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.

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

1 Answer 1

0

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,
    ...
4
  • 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
    Commented Sep 4, 2012 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
    Commented Sep 7, 2012 at 16:28
  • sorry to bother you again, but pls help?
    – Sam007
    Commented Sep 13, 2012 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
    Commented Sep 14, 2012 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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