Stan, Great work with this post so far, and your changes to the NearMe widget that you posted above.
I've been working on a couple of other changes, and thought I would ask your suggestions, and share my one solution.
1) First have you notice that the buffer graphics layer draws on the top of all features? And if you try to select a feature, over the buffer you cannot. I found a solution to this by reorder the buffer graphics layer when it is added in the "_initWidgetComponents" function (Widget.js - line 239 about):
I add this:
this.map.reorderLayer(this._bufferGraphicLayer, 0);
Seemed to work for me, just wondering if anyone else thinks this should be default or an option in the configuration.
2) Second, it would be nice to disable the click event when you mouse over a feature that you want to click on the pop up for. Right now the only way to select a feature(show pop up) is for you to close the NearMe widget window, and that disables the "Set location" click event. If someone wants to click on a feature it just re-buffers that location. My first thought is to disable that when you mouse over a feature (all my features are points, so I can see why it wouldn't be good with lots of polygon layers). Not sure if there is a better, easier way to do this. Thought?
3) Third, I am try to have ALL features in the map be selected by the Near Me Widget on application startup. The main reason is to show all the features in the NearMe widget panel on startup, it seems more intuitive as to what the tool does if a selection is already made. (no one reads instructions anymore...)
Any ideas about how to go about that? I've looked at the _getSelectedFeatureFromResult function, as well as the _initWorkflow function. Seems like I could create a new function that mimics a custom selection (all features) and invoke it on widget startup. Any ideas or suggestions?
Thanks again Stan! Go COUGS!