ArcGIS Server JavaScript API version 1.5 - Bug with Drawing Toolbar deactivation?
After upgrading our ArcGIS Server JavaScript API sites to version 1.5, we have noticed some strange behavior with our Drawing Toolbars.
We use a Drawing Toolbar to allow users to draw a line or polygon to select features on the map. The geometry from the drawing toolbar is used as the geometry in the Query for the QueryTask.
At version 1.5, we noticed the last segment of the line or polygon was not being used in the QueryTask results. Consequently, no features in the last segment of the geometry were selected on the map. All other segments of the geometry were working fine.
User Selection:
Parcel Results: (Notice the last segment did not return features)
Bug:
We use 3 different drawing toolbars on our site for measuring distances, selecting features, and drawing graphics.
The problem came when we activated 1 drawing toolbar, then deactivated another toolbar after the activation.
//switch to select toolbar
selectToolbar.activate(esri.toolbars.Draw.POLYLINE);drawingToolbar.deactivate();
Soultion:
At version 1.5, you must deactivate any toolbars before you activate one.
//switch to select toolbar
drawingToolbar.deactivate();selectToolbar.activate(esri.toolbars.Draw.POLYLINE);
At previous versions of the ArcGIS Server JavaScript API this was not a problem. I'm not sure if this falls into the category of a bug, but it is certainly something to be aware of when you migrate your applications to Version 1.5.
The ESRI Fourm blog referencing this issue can be seen here. Thanks to xiaoming - Prince William County for finding the work around.
Trent Tinker
Developer - ROK Technologies
Follow Us On Twitter

There are no comments for this entry.
[Add Comment]