Finish line draw using jimu/dijit/DrawBox

265
6
06-08-2018 10:59 AM
KarenRobine
Occasional Contributor II

I'm having an occasional issue when I use the Polyline tool to draw a line. On occasion, when I double-click to finish the line, the last line section (since last vertex drawn) disappears. Has anyone run into this issue before?  I do have snapping turned on when I draw a line, so I'm wondering if the snapping might be interfering with it.  Thoughts on how to resolve this issue?

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Karen,

   I can not say I have ever encountered that issue. Are you sure you are not accidentally moving/panning the map as you are trying to double click?

0 Kudos
KarenRobine
Occasional Contributor II

Nope. I'm sure.  I just single click my vertices. Then double-click to end the line.  One other thing I should note is that I have several widgets using this tool. In addition, I use the DrawBox tool in several instances in a single widget (ie., this.drawBox2, this.drawBoxSelect, and this.drawBoxPnt2Pnt are in the same widget). I am careful to deactivate the one that's not being used when the other one is activated.  It kind of feels like the problem is a timing thing. I'm just not sure what to do to fix it.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Karen,

  intermittent error like this are always the hardest to debug. I an not sure what to tell you. I guess I would try to narrow down my widgets code to least possible code as I debug it, and see if it stops having an issue with some piece being removed.

0 Kudos
KarenRobine
Occasional Contributor II

Yeah. I hear ya. I figured that was the next step. I was just hoping someone had an idea on what it could possibly be before I do that next step, as that can be quite tedious.  I'll post the answer when I figure it out. Thanks.

0 Kudos
KarenRobine
Occasional Contributor II

You've got me thinking about the possibility of panning while double clicking.  Do you do something to avoid this issue? I'll definitely research this possibility some more. I recall there's a way to check if the user is currently panning or maybe using mouse-event double-click or something. hmmm.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor