Override MapView Gestures

251
1
Jump to solution
01-24-2024 02:29 AM
mobileuser
New Contributor

The documentation of MapView says that gestures like pan, zoom, and rotate can be overriden. They are also marked as open. How can they be overriden when MapView is marked as final?

0 Kudos
1 Solution

Accepted Solutions
PuneetPrakash
Esri Contributor

>The MapView comes with default gestures to allow users to pan, zoom, and rotate the map specific to each platform. Platforms also allow you to override these gestures with your own. 

You can override the mapview's default gesture implementation by calling Android(platform) View's setOnTouchListerner() and passing your own implementation for the OnTouchListener. 
https://developer.android.com/reference/kotlin/android/view/View#setOnTouchListener(android.view.Vie...
You can do so in your code by calling , mapView.setOnTouchListener()

>They are also marked as open.
These are Events (s
haredFlows) which emit a particular gesture event and will not work if you override  mapview's default gesture implementation with your own.




View solution in original post

0 Kudos
1 Reply
PuneetPrakash
Esri Contributor

>The MapView comes with default gestures to allow users to pan, zoom, and rotate the map specific to each platform. Platforms also allow you to override these gestures with your own. 

You can override the mapview's default gesture implementation by calling Android(platform) View's setOnTouchListerner() and passing your own implementation for the OnTouchListener. 
https://developer.android.com/reference/kotlin/android/view/View#setOnTouchListener(android.view.Vie...
You can do so in your code by calling , mapView.setOnTouchListener()

>They are also marked as open.
These are Events (s
haredFlows) which emit a particular gesture event and will not work if you override  mapview's default gesture implementation with your own.




0 Kudos