I've setup Proxy, the Overlay Proxy module and am now trying to show some GML layer data in the WMS block - I've turned off the Proxy whitelist and keep getting this printed in the block ("Array ( [0] => Invalid response: 404: Not Found ) ") when I click on a layer which I know has feature info that should be displaying. When I look at the recent Drupal log messages I see:
Notice: Undefined offset: 1 in wms_ajax_wmsgetfeatureinfo() (line 52 of /var/www/vhosts/sitename.org/dev/httpdocs/sites/all/modules/wms/wms.module).
When I look at like 52 of the wms.module I can see that the error seems to be generated from this line:
'layer' => $layertp[1],
(in the wms_ajax_wmsgetfeatureinfo() function.)
Additional notes:
- I'm using Openlayers 7.x-2.0-beta7+24-dev
- I'm using Openlayers Plus 7.x-3.0-beta1+15-dev
Any ideas/suggestions?
Also - where can I actually check the query which is being run in order to verify that it works along the lines of this example - which works:
http://128.100.66.64/cgi-bin/mapserv.exe?map=C:/ms4w/maps/wms_tilecache/...
Thanks,
Qasim
Comments
Comment #0.0
designguru CreditAttribution: designguru commentedadded module versions
Comment #1
batje CreditAttribution: batje commentedMy first guess would be that the wms module has an issue with the spaces in the name of the layer.
If you want to see what happens in the module, you could always run the code through your debugger (or install the devel menu, and add some dpm($something) statements.
I wont be able to work on this issue in the next 2 weeks.
Comment #2
designguru CreditAttribution: designguru commentedI'll try and run some tracking on the module through devel later today and post back with findings; I was testing with layers named 'wms_urban_growth' etc - so spaces shouldn't be a problem (the module should try and query by layer name not title right?)
q./
Comment #3
designguru CreditAttribution: designguru commentedAs it turns out, the Openlayers implementation we're using is generating layers in a non-standard way - so I need to call a different URL than the Base URL we've entered in the Drupal OpenLayers module:
Instead of:
http://128.100.66.64/cgi-bin/tilecache/tilecache.py?VERSION=1.1.1&REQUES... ....
It should be say:
http://128.100.66.64/cgi-bin/mapserv.exe?map=C:/ms4w/maps/wms_tilecache/... ....
Where 'wms_bnd_muniupper' is the name of the layer being called (the mapserver automatically creates the data as a layername.map file when it is queried.)
From looking at the WMS module code I'm confused as to where I would edit the module in order to override the base layer for the query.... I just can't see where its being called (assumedly I'd need to edit modules/wms/plugins/behaviors/js/openlayers_behavior_wmsgetfeatureinfo.js)
q./
Comment #4
designguru CreditAttribution: designguru commentedI ended up customizing the code in openlayers_behavior_wmsgetfeatureinfo.js around line 100 to call the actual mapserv.eve URLs we need for this project as follows.
This meant replacing:
With:
Of course, you'll note that the above is querying per layer and the query gets messed up when multiple layers are active and someone clicks on them - unfortunately my javascript isn't very good so this is little cumbersome for me, but now it seems the task is to turn the above into something which works to query multiple layers...
Any help/insight is welcome...
q./
Comment #5
batje CreditAttribution: batje commentedIn the .js the URL of the layer request is built up by calling this function:
http://dev.openlayers.org/docs/files/OpenLayers/Layer/WMS-js.html#OpenLa...
If you make sure that the first WMS layer is configured correctly in the OpenLayers backend, then theoratically it should work. Sorry, I havent tested this on anything else then linux + geoserver.
Comment #5.0
batje CreditAttribution: batje commentedexample added
Comment #6
batje CreditAttribution: batje commented