AnsweredAssumed Answered

How to Link Query Results with Map Graphics

Question asked by william.miller_WarrenCoGIS on Mar 9, 2017
Latest reply on Mar 15, 2017 by william.miller_WarrenCoGIS

Hello,

I'm working on a widget that takes user input, such as school district, sale date range, sale price range, etc., and uses esriRequest to pass those values to a non-ArcGIS rest service. The rest service puts the request in SQL format, queries a non-ArcGIS database and returns information, such as account number, address, sale date, sale price, buyer, seller, square footage, etc., on the parcels that match the user's parameters. A queryTask is performed to add a featureSet of the graphic to each result. Then a list of results are displayed in the widget and graphics are added to the Graphics Layer. Now I need the results in the list to link to the corresponding graphic so when it's click, the map zooms to the result on the map and displays its infoTemplate. How do I go about doing this? Should I add the graphics to a new layer? If so, would it be a FeatureLayer and how would I create it? I saw that FeatureLayers can be created from a featureCollection, but how do I create the layerDefinition and featureSet that are needed to create the featureCollection?

Any help is greatly appreciated.

Thank you.

William

Outcomes