[OpenLayers-Users] Get features from xy

Beretta Ruggero r.beretta at starch.it
Thu Jun 5 11:12:14 PDT 2014


Hi guys,
I think (hope!) it's a simple thing, but it's all day I'm looking for a solution without any success.
Is possible to get features from xy without using the GetFeatureInfo control?
I have a WMSGetFeatureInfo but I have to catch the feature on beforegetfeatureinfo event.

Here is my code:

infoCtl=Map.getControlsByClass('OpenLayers.Control.WMSGetFeatureInfo')[0]
infoCtl.events.register("beforegetfeatureinfo", Map, onBeforegetFeatureInfo)

function onBeforegetFeatureInfo (e){
var myFeature

myFeature=SomethingToGetTheFeaturesFromXY(e.xy) //this is what I miss!

myFeature.attributes["MyNewAttribute"]=LoadFromWebService(myFeature.ID) //I add some attributes dynamically
}

Thanks in advance
Best Regards
Ruggero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20140605/38c5a40a/attachment.html>


More information about the Users mailing list