(if am well aware there is another attempt at implementing this here http://drupal.org/node/860444 )

Attached is my attempt at implementing GetFeatureInfo functionality. It works, you can query layers and display the result. The result even looks nice. It is not finished though.

Main challenge I face, is that I would like the server to do the GetFeatureInfo request (using the proxy module) and then process the result on the server (including firing a hook for interested modules). This way, the results of the GetFeatureInfo request can be themed. (The default html just looks so horrible) and there can also be some processing of information.

I got stuck with the namespacing of the GetFeatureInfo result. There are some remarks about that in the test, pointing to where i got lost. Some help there would be highly appreciated.

The current implementation works, and does render the result of the GetFeatureInfo request using the http://drupal.org/project/js_theming module, which seems highly abandoned, and needs a patch #938998: indexOf on array does not work before it works. The result does not look bad at all though.

There is also an additional option that will create a link to a function in the module, that posts the whole record that was fetched in a GET request. You can do whatever you want there with the information. (I create nodes)

I called the module WMS, because well, this is WMS specific functionality. Like WFS is called WFS.

Feedback is highly appreciated, and I totally agree that this is also a duplicate effort. I missed it when I started working on this module.

I didnt create a new project, awaiting feedback (and because i am not sure if this is a good name, as this module does not have the WMS layers functionality).

CommentFileSizeAuthor
wms.tar_.gz13.81 KBbatje

Comments

tmcw’s picture

Hey, looks cool.

  • This code triggers 44 warnings, 2 critical warnings with the coder module. There are also 114 warnings with gjslint for the Javascript.
  • It seems like you could use a native Javascript theming system like ejs rather than js_theming, and avoid the patch + Drupal dependency.
  • You're right about using module_implements in a hook, I hadn't realized that it static-caches internally!
tmcw’s picture

Status: Needs review » Postponed (maintainer needs more info)

Okay; this is okay for a separate module, but shouldn't hang around this issue tracker much longer.

batje’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

ok. will move it.

quiron’s picture

Hi all!

I'm working with openlayers and I have a similar issue. I should use GetFeatureInfo request when a point is clicked in the map. In openlayers I found an example (http://openlayers.org/dev/examples/getfeatureinfo-control.html) and the element of the API (http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/Open...)

My problem is to integarte it with drupal Openlayers module. I have read in the issue list some stuff about it. Any way the response is always that this functionality will not be included.

I need to develop it and I like to make the code reusable, so any suggestions are welcomed.

I'm thinking in different approaches:
1) Create a new behavior
2) Create a new module as you suggested before, but I don't know with wich hooks I should work with

I'm sorry but english is not my mother language

thanks a lot

tmcw’s picture

quiron: look at batje's code and possibly get in touch with him.

geomartino’s picture

quiron: I'am currently looking for a GetFeatureInfo functionality inside Drupal7/Openlayers which look very similar to yours. Anything new to share on this?

batje’s picture

We will spend some time with this module in the fall probably. Upgrading to Drupal 7 is very late in the year for us.

Will be at Drupalcon, would be great to talk wms.

batje’s picture

Component: Behaviors » OL API

I created a sandbox for a Drupal6 version of the module. It comes with a demo feature. It is a sandbox for now but it works and it passes all reasonable coder tests, too.

http://drupal.org/sandbox/batje/1244928

Feedback, or a patch for a Drupal7 upgrade are much appreciated. We will probably be upgrading the site where we use the module later this year.