Equipment search across the layers

777
3
06-19-2014 10:04 AM
BhavinSanghani
Occasional Contributor II
How can I perform search across the layers? I need to search provided equipment across the layers and other equipment too which are falling in the given radius. e.g. Search all equipment across 5 layers based on the selected equipment (or it's geometry) and provided radius. Radius can be different for each layer.  

I use following logic but I am thinking may be if there is any better way.

1) Find out equipment's geometry by using QueryTask
2) Create instance of Circle based on the geometry I get from point # 1 for all layers and query again for all layers.

Any suggestions?
0 Kudos
3 Replies
VernWolfley
New Contributor III
Something like this example?
https://developers.arcgis.com/javascript/jssamples/query_buffer.html
It sounds like you just need a buffer query.
0 Kudos
BhavinSanghani
Occasional Contributor II
This example query only 1 layer. I need to query multiple layers and also with different radius/uom on each layer. I want to avoid looping through all layers and search the equipment.
0 Kudos
YungKaiChin
Occasional Contributor

Let me know if you still need help.

In generally, you can pass an array of layers to a function.

Each time you loop through the array, you execute an querytask.

Last, use an instance of "dojo/promise/all" to wait until all results are received and do something.

0 Kudos