Snapping Issue with ArcGIS API for JavaScript 3.x

818
3
07-07-2021 04:59 PM
HenryKo2
Occasional Contributor

When we try to snap to line geometries, occasionally the snap does not stick to the line. This happen s intermittently. It used to work with version 3.22, but we recently upgraded to 3.35, and users have started to report this issue.

Please see the attached animated GIF for an example:

Animation.gif

I'm trying to move the blue dot on the line by snapping to the line. To do so, I press the CTRL key to snap to the line. The CTRL key will show a green ring to indicate snapping.

So on the right of the line, snapping is working as expected - the green ring shows. BUT as I slide along the same line to the left (still holding on the CTRL key), the snapping stops working and the green ring disappears. This means I cannot stick the blue dot accurately on the left portion of the line.

The line is a single line geometry, there's nothing special about it (also the issue happens with other lines). 

This used to work with version 3.22, and nothing has changed apart from upgrading the JS API to 3.35.

Has anyone else seen this issue?

0 Kudos
3 Replies
JoseBanuelos
Esri Contributor

Hello @HenryKo2 ,

Could you provide a simplified reproducible test case  on codepen? I have not been able to reproduce this issue at 3.37 or 3.35. Could you also test 3.37 if possible?

Thanks,

Jose

0 Kudos
HenryKo2
Occasional Contributor

Thanks for the reply @JoseBanuelos. Unfortunately our web app is a massive productionised enterprise framework, so  hard to change the version and produce a minimum reproducible example. However I'll think about it a bit more.

TimSexton1
Occasional Contributor

Out of curiosity, what was the line width set to on the linear features you were attempting to snap to in the example you originally provided?  Was it > 1.5?

The reason I ask is we've recently discovered an issue with MapView's hitTest when lines are drawn at angles and have a width > 1.5 and was wondering if this issue is related to what we found in 4.x as reported here: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-c...

0 Kudos