Drawing Tool sometimes locks pan tool and can never finish drawing a polygon/polyline

1529
10
07-25-2012 11:07 AM
ChuanHung
New Contributor
Hi

I'm developing a map application using Javascript API and I noticed (1) sometimes I can't pan the map after using the freehand drawing tools and (2) sometimes I can never finish drawing polyline/polygon by double clicking. At first I thought it's a problem in my code but then I found out the problems also exist in this sample . Could this be a bug in the API and is there any way to work around it?

Steps to reproduce problem (1)
1. Draw a Point on the map
2. Draw a Freehand Polyline on the map
3. Draw a Point on the map again
Now try to pan the map. It's no longer possible

Steps to reproduce problem (2)
1. Draw a Point on the map
2. Draw a Polyline on the map (not freehand)
3. Draw a Point on the map again
Now try to draw another Polyline (not freehand). Each time we double click it just adds a new vertex and we can never finish drawing the line

Thanks in advance!
0 Kudos
10 Replies
ChuanHung
New Contributor
I found a workaround for (1) by activating esri.toolbars.Navigation.PAN for my own navigation tool each time after I deactivate the drawing tool. I am still unable to fix problem (2). I guess I can just use freehand drawing tool for now but I'd love to see if there's a fix for problem (2). Thank in advance.
0 Kudos
JianHuang
Occasional Contributor III
This is a bug. We will fix it very soon.
Thanks for reporting this.
0 Kudos
ChuanHung
New Contributor
No problem Jian and thanks for replying back!
0 Kudos
MarkHoover
Occasional Contributor II
Has there been any resolution to this yet?
0 Kudos
JianHuang
Occasional Contributor III
This was an issue introduced with dojo 1.7. We will fix it in the next release.
At this moment, the fix you can apply is to set a bunch of events as null when deactivating the toolbar. For instance, the sample:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_draw.html
can be modified as:
    function addToMap(geometry) {
      toolbar.deactivate();
      toolbar._onMouseDownHandler_connect = toolbar._onMouseMoveHandler_connect =
      toolbar._onMouseDragHandler_connect = toolbar._onMouseUpHandler_connect =
      toolbar._onClickHandler_connect = toolbar._onDblClickHandler_connect =
      toolbar._onKeyDown_connect = toolbar._redrawConnect = null;
      ...
    }
0 Kudos
MarkHoover
Occasional Contributor II
Worked like a charm.  Thanks, Jian!
0 Kudos
MahenderShah
New Contributor
This was an issue introduced with dojo 1.7. We will fix it in the next release.
At this moment, the fix you can apply is to set a bunch of events as null when deactivating the toolbar. For instance, the sample:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_draw.html
can be modified as:
    function addToMap(geometry) {
      toolbar.deactivate();
      toolbar._onMouseDownHandler_connect = toolbar._onMouseMoveHandler_connect =
      toolbar._onMouseDragHandler_connect = toolbar._onMouseUpHandler_connect =
      toolbar._onClickHandler_connect = toolbar._onDblClickHandler_connect =
      toolbar._onKeyDown_connect = toolbar._redrawConnect = null;
      ...
    }


Hi,

We are using ArcGIS 3.6 javascript API. Can you please confirm if this issue of dojo is resolved in the latest 3.6 javascript api. Also if possible can you please provide the ticket no of this dojo bug?

Thanks
Mahender
0 Kudos
VinayBansal
Occasional Contributor II
Hi ,

I am using ArcGIS Javascript API 3.4 and ArcGIS Server 10.1 SP1.
After reading this post, I tested my application widget and as described in this post Problem 2. It's not occuring in my widget. What we did in the widget is that we have created a seperate graphic layer for adding the geometries from draw toolbar and enabling the map navigation after deactivating the toolbar in addGeomToMap function.
Hope this helps someone.....


Regards,
Vinay Bansal
0 Kudos
MahenderShah
New Contributor
Hi Vinay,

Thanks for the update. But I exactly want to know is that since this was a bug of dojo 1.7 as mentioned by Jian, So is this bug resolved in dojo 1.8, so that we don't have to use any work around for this ?

Thanks
Mahender
0 Kudos