I have an Esri map loaded using the javascript api. I try to enable snapping, where a point should always snap to a given line.
I have a snap point symbol that will trace the line to snap to when I drag the edited point around. When I release the mouse, the edited point should snap to the line.
This works perfect on desktop, but when I try on iPhone 5 and HTC One, the snapping is not activated. The snap symbol is never shown when I drag the point, and it is not snapped when I release.
This is the code for how I enable the snapping:
map.enableSnapping({
snapPointSymbol: snapSymbol,
tolerance: 20000,
alwaysSnap: true,
layerInfos: [{ layer: map.graphics, snapToPoint: true, snapToVertex: true, snapToEdge: false}]
});
Emulation testing:
When I try to emulate this in Chrome developer tools, I see the same problem for iOS devices, but not for Android or any other types of device. It seems like the ESRI code is sniffing the user agent string, and if it finds an iOS specific value in the user agent, the snapping is disabled.
Real device testing:
Reproduced on iPhone 5 (iOS 7) and HTC One.