AnsweredAssumed Answered

Unify two functions in just one to be called by a button

Question asked by on Feb 9, 2017
Latest reply on Feb 10, 2017 by



I think this is a basic mistake I'm making, but I can not understand why.


I need to unify two functions that are called on two different buttons (first the _createPoint function and then the _search function) on just one button. The idea is simple. I created a new function, called _createBuffer, and inside it, I called in sequence to _createPoint and _search.


The problem is that when run by this unified function that I created, the line "var currentGraphic = [0];" Of the _search function always returns "undefined", causing error in the rest of the code.


Does this occur because the graphical layer is still not actually on the map? I'm attaching the code for the entire widget.


Thanks for any help.