Hello,
I want to use the features returned from a search in a new widget. How can my new widget access the currently selected features (FYI - features selected using the 'Enhanced Search' widget.
Any and all help would be appreciated.
thanks,
Mike
Thank you Robert.
This was very helpful. I will test this out later today.
Mike,
If you choose "Add Result as Operational Layer" then you can use some code like this in your other widget:
var slyr; array.some(this.map.graphicsLayerIds, lang.hitch(this, function (layerId) { var lyr = this.map.getLayer(layerId); if(lyr.name === "Search result: Parcels"){ /*change "Parcels to the name of your layer */ slyr = lyr; return true; } })); if(slyr){ array.map(slyr.graphics, lang.hitch(this, function(gra, index){ //do something with the selected graphics })); }
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.