how to draw a line snapping to existing line feature

2695
3
02-14-2012 05:16 PM
LuhuaCai
New Contributor
I am working on a project that able to let users draw a line that snap to an underlining road network when the line is within a set distance of the underlining road. Can this be done using the editor widget? any suggestion would be greatly appreciated.

Thank you,
0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
Take a look at the  map's enableSnapping method. enableSnapping allows you to setup snapping options when working with the Editor or the Edit and Draw toolbars.

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/map.htm#enableSnapping
0 Kudos
PeterPuck
New Contributor
Hello there,

as you can not rely on the current state of the internal snapping manager, I had to setup the snappingManager which is returned by enableSnapping();
( there is an "setLayersInfo" function ...)
0 Kudos
LuhuaCai
New Contributor
Thanks for the information. the enablesnapping worked well for me.
0 Kudos