Thanks! I already knew about featureselected -- but I must have overlooked that extra 's'!!!!<div><br></div><div>Cody<br><br><div class="gmail_quote">On Tue, Jun 14, 2011 at 9:46 PM, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Tue, Jun 14, 2011 at 11:56 PM, codydjango <<a href="mailto:codydjango@gmail.com">codydjango@gmail.com</a>> wrote:<br>
><br>
> In this case your callback isn't called because of the Fixed strategy.<br>
>> The strategy calls protocol.read and provides its own callback to the<br>
>> read method, so this overrides the "global" callback. If your app code<br>
>> does protocol.read() somewhere then your "global" callback func will<br>
>> get invoked.<br>
><br>
> Hello -- I'm new to openlayers, and I've been running into some issues,<br>
> probably because I'm new. One of the first things I wanted to do was draw a<br>
> box, have the server return all the features in the box, and then "do<br>
> something" with them.<br>
><br>
> I thought I'd use something like this:<br>
><br>
> var getFeatures = new OpenLayers.Control.GetFeature({<br>
> box: true,<br>
> click: false,<br>
> multiple: true,<br>
> protocol: new OpenLayers.Protocol.HTTP({<br>
> url: '/obj',<br>
> format: new OpenLayers.Format.GeoJSON(),<br>
> params: {<br>
> limit: 2000<br>
> }<br>
> })<br>
> });<br>
><br>
> What is the best way to set a custom callback to go off once their is<br>
> response data to work with?<br>
<br>
</div>The control triggers "featuresselected" events when features are received.<br>
<div class="im"><br>
var getFeatures = new OpenLayers.Control.GetFeature({<br>
box: true,<br>
click: false,<br>
multiple: true,<br>
protocol: new OpenLayers.Protocol.HTTP({<br>
url: '/obj',<br>
format: new OpenLayers.Format.GeoJSON(),<br>
params: {<br>
limit: 2000<br>
}<br>
</div> }),<br>
eventListeners: {<br>
featuresselected: function(e) {<br>
// do something with e.features<br>
}<br>
}<br>
});<br>
<br>
<br>
--<br>
Eric Lemoine<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</blockquote></div><br></div>