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.
How can I get snapping to work on mobile device?
-
1This honestly sounds a bug that ESRI customer support should be able to help you with.Senshi– Senshi2018年02月08日 11:14:40 +00:00Commented Feb 8, 2018 at 11:14
1 Answer 1
This is a documented bug:
You might want to contact Esri to see if and when they plan to fix this bug, since the bug status is 'In Product Plan'.
-
OK, this verifies that it does not work... What about a workaround? Is it possible to do some query that gets nearby features and do the "snapping" manually in some editor events?awe– awe2018年02月09日 10:23:30 +00:00Commented Feb 9, 2018 at 10:23
-
I don't know how to work around this, sorry. As I said, I would contact Esri support to get more info, since apparently the bug fix is 'in product plan' for more than 2 years.GISGe– GISGe2018年02月09日 12:02:36 +00:00Commented Feb 9, 2018 at 12:02
-
OK. I think I'll leave the bounty open for now in case someone else come up with a workaround.awe– awe2018年02月09日 12:09:06 +00:00Commented Feb 9, 2018 at 12:09
-
Explore related questions
See similar questions with these tags.