AnsweredAssumed Answered

map.enableSnapping() - Async?

Question asked by JSim on Jan 15, 2014
Latest reply on Jan 5, 2015 by drahoslav.lacny
I am wondering if map.enableSnapping() has any asynchronous processing associated with it and if so are there any events I can listen to or a deferred promise that I can wait for?
I???ve done a bit of testing and it appears that this is the case.

If I do the following steps:

  1. enable snapping

  2. load in the feature layer (this waits for an ???onUpdateEnd??? event to fire which lets me know the layer is on the map)

  3. turn on the draw tool

Everything works fine however if I change the order to this:

  1. load in the feature layer (this waits for an ???onUpdateEnd??? event to fire which lets me know the layer is on the map)

  2. enable snapping

  3. turn on the draw tool

Snapping does not work on the first draw (it will work on subsequent ones).

Outcomes