I am creating a widget by using GP service. My code works fine in Sandbox. When I move into the widget, the first part of running Geoprocessor is fine and I can see the feature result in Console Window, but my last part - the graphic result cannot show in the map. The error message says “this.map.graphics is undefined”.
I attach my widget code and sandbox code. My widget code is to open the widget then the GP starts. I wonder how to make the GP result shows in the map.
Thanks,
Helen
Solved! Go to Solution.
Helen,
So you just forgot the lang.hitch part:
//you have
this.gp.execute(params, this.getDriveTimePolys);
//Should be
this.gp.execute(params, lang.hitch(this, this.getDriveTimePolys));
Helen,
So you just forgot the lang.hitch part:
//you have
this.gp.execute(params, this.getDriveTimePolys);
//Should be
this.gp.execute(params, lang.hitch(this, this.getDriveTimePolys));
Robert,
Thank you very much for the help. You are right and it works now. I should give it try by using --
this.gp.execute(params, lang.hitch(this, this.getDriveTimePolys))
Best,
Helen