Thomas, You don't see the mapclick event interaction because that is all hidden (included in the DrawTool). What you will find in the draw widget is there is a button that fires the setMapAction and the MapManager actually has the DrawTool defined and it adds and removes map click event listeners internally. Hope that sheds a little more light on this for you. So you lay out a road map for your widget, it would need a button that fires the activateDrawTool function below:import com.esri.ags.tools.DrawTool;
import com.esri.ags.events.DrawEvent;
import com.esri.ags.geometry.MapPoint;
private function activateDrawTool(event:MouseEvent):void
{
addSharedData("Deactivate_DrawTool", null); // to be able to deactivate drawTool on other widgets
setMapAction(DrawTool.MAPPOINT, "My tool that does something", new SimpleMarkerSymbol("circle",12,0x0000ff,0.8), DrawEnd);
}
private function DrawEnd(event:DrawEvent):void
{
//deactivates the drawTool
event.target.deactivate();
var geom:Geometry = event.graphic.geometry;
//If you want to persist the point on the map
var gra:Graphic = new Graphic(geom, new SimpleMarkerSymbol("circle",12,0x0000ff,0.8));
graphicsLayer.add(gra);
//snippet of code from the smaple
query.geometry = geom;
queryTask.execute(query);
}