"Snap" point in ArcGISDynamicMapServiceLayer?

Discussion created by ajmorris on Aug 4, 2010
Latest reply on May 19, 2014 by ajmorris
I doubt this can be done, but maybe someone has some ideas. Using the Javascript API, I want to snap a point to a line.

I am accessing an ArcGISDynamicMapServiceLayer. It contains polylines, and a query task. I know that I can execute a query to find lines that are close to the point. But, what I need is the EXACT closest point along that line. Is there a simple way?

One thought is to enumerate all the points along that line, compute the straightline distance, and search for the minimum. But, I don't know how to compute that line to points.