AnsweredAssumed Answered

How can I keep my Map click handler from responding to the Draw Toolbar?

Question asked by delies on Apr 9, 2015
Latest reply on Apr 9, 2015 by delies

I just recently realized that my Map.graphics click handler has been interfering with the Draw Toolbar.  When I draw polylines and I click to start a new line in the same poly, the click (which always falls on the line) causes errors because my handler only expects to handle the graphics that I have added, not those from the draw toolbar.  My first instinct is to use a distinct graphics layer for the draw toolbar.  This would cause the least changes in my code.  If not possible, the only other solution I see is to use a distinct graphics layer for my graphics.  This would take a lot more work on my part. Is it possible to use a different graphics layer than the map's default graphics layer for the draw (and edit) toolbar? If not, is there maybe another solution I'm not considering?  My click handler code could be changed, but I don't know what would always distinguish my graphics from those created by the draw toolbar.

Outcomes