In my app it is possible to issue queries on the same layer in rapid enough succession that the issue of out-of-order execution of the response is an issue. Is there any way of tagging the queries so they can be identified in the callback? I saw on the IOS thread that an NSOperation associated with each query can be used for this purpose. Is there any mechanism in the Javascript toolkit for identifying what query invoked the callback?The only thing I can think to do is to associated each query with a different (identical except that the function itself serves as an id) callback function, but that seems pretty lame.Thanks,Rex BradfordDirect Relief International
task.execute(q, dojo.hitch(this, "searchCallback", layerData.name, layerdesc, layerData.titleField));
searchCallback: function(layerId, layerdesc, titleField, featureSet) {
Instead of different callbacks, why not just pass an additional identifying variable to the callback along with the resultsetwe do:task.execute(q, dojo.hitch(this, "searchCallback", layerData.name, layerdesc, layerData.titleField));. which allows us to use just one callback but have layer dependent functionality.our searchCallback then looks likesearchCallback: function(layerId, layerdesc, titleField, featureSet) {
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.