Using the Web Application Builder, I am trying to make a Measurement widget that will snap to one particular (line) feature layer. The snapping at first appears to be working on the map: Hovering the mouse near a feature will create the default blue + symbol on the feature. However, no actual snap occurs when the mouse is clicked. The same happens when trying to complete the measurement. The start and end points don't actually snap at all, they are set where the mouse pointer is, not where the blue + is.
I found that if I do not specify layerInfos in the code below (line 25), the snapping works correctly. The problem is that the snapping manager will not use my line feature layer and instead defaults to a different layer in the map. What is wrong in the code below that is causing the actual snap part of the process to fail?