AnsweredAssumed Answered

SnapManager not drawing point at the snap

Question asked by minnag on May 14, 2018
Latest reply on May 18, 2018 by minnag

SnapManager fails to complete snap in Javascript


I am having a problem similar to the one Tyler described but the previous post did not solve my problem. I have a custom widget with a click event that uses the snapping manager to guide the user to place a point along a road. The road is in a feature service and I am using the draw toolbar to create the point. Snapping at first seems to be working great to the point of creating the little blue X that is constrained to follow the road, however, when the user actually clicks the point will be created at the actual click point and not where the blue X is showing.


How can I make the snapped point graphic actually be created on the line where the blue X seems to indicate it will be?

Right now I am adding the featurelayer to the map every time the user clicks, which is not practical in the long run, but I am just trying to get it to work.


Thank you for any help in solving this problem.


myfunction: function (evt) {

var parcelsLayer = new FeatureLayer(
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]

var snapManager ={
tolerance: 20,
alwaysSnap: true

var layerInfos = [{
layer: parcelsLayer


var tb;
tb = new Draw(;

var line = new SimpleLineSymbol();
line.setColor(new Color([168, 0, 0, 1]));
var marker = new SimpleMarkerSymbol();

var graphic = new Graphic(evt.mapPoint, marker);;