AnsweredAssumed Answered

Show GIS attributes using QueryTask, FindTask and IdentifyTask

Question asked by bforbhavin on Sep 4, 2014
Latest reply on Sep 5, 2014 by bforbhavin

I need to show GIS attribute values in tree view following way in for the UCs mentioned below:

 

-LayerName

           - FeatureID

                    - Feature Attributes

           - FeatureID

                    - Feature Attributes

-LayerName

           - FeatureID

                    - Feature Attributes

           - FeatureID

                    - Feature Attributes

 

Use cases:

 

1) If user passes single/multiple objectIds then search these values in all layers and show the layer and attributes in treeview

2) If user clicks on the map then search mappoint geometry to find gis attributes in visible layers and show the treeview

 

For # 1 - there are two scenarios

a) single objectId - I can use FindTask or QueryTask

b) multiple objectIds - I can use QueryTask

 

For # 2 - I can use IdentifyTask

 

Questions:

i) Is there any generic way to cover all these scenarios using same code?

ii) QueryTask doesn't return layerName when you query it  to multiple layers and fetching results in dojo/promise/all. What could be the solution in case of fetching attributes of multiple objectIds with layerName in results?

iii) FindTask or QueryTask - which one is better? FindTask doesn't allow to search text for multiple ids and QueryTask doesn't give layerName in the result when querying to multiple layers.

Outcomes