touchDelegate

664
5
12-19-2018 02:13 AM
wangchao1
New Contributor II

the touchDelegate has method “didTapAtScreenPoint” “didTouchDownAtScreenPoint” “didTouchUpAtScreenPoint”. But when I give “completion(YES)” to “didTouchDownAtScreenPoint”, “didTapAtScreenPoint”  will has no response, and the map can’t be drag.Now I need method “didTapAtScreenPoint” has a response and I need a method to know when a tap or drag gesture start and end and don’t interrupt the gesture. What should I do?

0 Kudos
5 Replies
Nicholas-Furness
Esri Regular Contributor

If you respond with YES to didTouchDownAtScreenPoint, you are telling the Runtime that you want to handle the entire tap or drag gesture and so Runtime will not make the map track your finger around the screen. You will then receive didTouchDragToScreenPoint delegate events until the drag gesture completes with a single didTouchUpAtScreenPoint event.

If you respond with NO to didTouchDownAtScreenPoint (or don't implement the delegate method) then Runtime will handle a drag and move the map to accompany the drag gesture, or handle a tap via the didTapAtScreenPoint.

If you just want to detect taps on the map, simply implement the didTapAtScreenPoint delegate method and don't implement didTouchDownAtScreenPoint (or implement it to return NO), didTouchDragToScreenPoint and didTouchUpAtScreenPoint.

Let me know if that helps.

0 Kudos
wangchao1
New Contributor II

I have know the relationship between the methods,but what I need is make didTapAtScreenPoint works and at the same time, monitor both drag and tap gesture's start and end.

here is what I'm facing,  I'm now using "setViewpoint:(AGSViewpoint*)viewpoint duration:(double)duration" to turn the map with a degree. while if there is a drag or a tap in the turning duration, the turning whill stop, what I want is monitor the gesture that interrupt the turnning and continue the turnning. and didTapAtScreenPoint is a important method I  use  to do other things.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Do you need to perform some action when the user taps while the map is animating to its new rotation, or do you just need to ensure the tap does not stop the rotation?

0 Kudos
wangchao1
New Contributor II

Actually, I just need to ensure the tap or drag does not stop the rotation, if it stoped  I need to continue the rotation at the time the tap or drag finish.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Apologies for the delay in getting back to you.

You could try disabling the user interactions until the rotation is complete by setting the AGSMapView.interactionOptions.enabled = false (see this and this).

Let me know if that works for you.

0 Kudos