[OpenLayers-Users] Getting feature information from a mouse click

Christopher Schmidt crschmidt at metacarta.com
Fri Oct 27 10:14:47 EDT 2006


On Fri, Oct 27, 2006 at 08:32:12PM +0800, Lee Wai See wrote:
> Hi,
> 
> How can I get the map information of a feature upon a mouse click? I saw in
> the click example that it is possible to get the lon-lat values upon mouse
> click. Is it possible to go a step further to get the information of a
> feature? I would greatly appreciate immediate help on this, as I need to
> rush for a deadline. Thanks a lot.

At http://world.freemap.in, you can see an example of how to parse WFS
responses for displaying the information in the page.

At http://openlayers.org/dev/examples/getfeatureinfo.html , you can see
a simpler example that uses a WMS GetFeatureInfo request.

Any answer will depend on how you extract feature information from your
server, and the desired visual results are typically application
specific as well. This is one of the reasons that this functionality has
not been implemented for OpenLayers in general: thus far I have not seen
any query mechanism which is generalized enough to be useful in most
situations. 

If you have some other query mechanism you would like to see an example
for, I suggest you send email to the list describing the protocol for
extracting information, so that other users on the list can assist you.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list