<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1294899#M58</link>
    <description>&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;onSingleTapConfirmed,&amp;nbsp;&lt;/SPAN&gt;OnUp, and OnDown events got triggered simultaneously with separate lifecycle scopes launch like below,&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;lifecycleScope&lt;/SPAN&gt;.&lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    repeatOnLifecycle(Lifecycle.State.&lt;SPAN&gt;STARTED&lt;/SPAN&gt;) &lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            (&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;onSingleTapConfirmed &lt;/SPAN&gt;&lt;SPAN&gt;as? &lt;/SPAN&gt;SharedFlow)?.collect &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;/*handle the onSingleTapConfirmed Event*/&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            (&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;onUp &lt;/SPAN&gt;&lt;SPAN&gt;as? &lt;/SPAN&gt;SharedFlow)?.collect &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;/*handle the onUp Event*/&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            (&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;onDown &lt;/SPAN&gt;&lt;SPAN&gt;as? &lt;/SPAN&gt;SharedFlow)?.collect &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;/*handle the onDown Event*/&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    }&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But still not sure how to handle the OnMove event when&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;interactionOptions&lt;/SPAN&gt;.&lt;SPAN&gt;isPanEnabled &lt;/SPAN&gt;= false&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 09:36:21 GMT</pubDate>
    <dc:creator>GPK</dc:creator>
    <dc:date>2023-06-01T09:36:21Z</dc:date>
    <item>
      <title>How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1294469#M51</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Currently, I am migrating the ArcGis dependency from Runtime 100.13.1 to MapsSDK 200.1.0. Struggling with MapView's gesture handling.&lt;/P&gt;&lt;P&gt;With 100.x we have&amp;nbsp;DefaultMapViewOnTouchListener through that the onSingleTapConfirmed and &lt;STRONG&gt;OnTouch(Up, Down, and Move)&lt;/STRONG&gt;&amp;nbsp;events got handled, the same onSingleTapConfirmed available as SharedFlow in 200.x but the onTouch event is not available I can see &lt;STRONG&gt;OnUp&lt;/STRONG&gt; and &lt;STRONG&gt;OnDown&lt;/STRONG&gt;&amp;nbsp;SharedFlows but not triggering at all. Also, how do I handle &lt;STRONG&gt;OnMove&lt;/STRONG&gt; event in the mapview?&lt;/P&gt;&lt;P&gt;UseCase: Identify the features by drawing a box on mapview via TouchListeners!&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 13:46:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1294469#M51</guid>
      <dc:creator>GPK</dc:creator>
      <dc:date>2023-05-31T13:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1294899#M58</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;onSingleTapConfirmed,&amp;nbsp;&lt;/SPAN&gt;OnUp, and OnDown events got triggered simultaneously with separate lifecycle scopes launch like below,&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;lifecycleScope&lt;/SPAN&gt;.&lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    repeatOnLifecycle(Lifecycle.State.&lt;SPAN&gt;STARTED&lt;/SPAN&gt;) &lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            (&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;onSingleTapConfirmed &lt;/SPAN&gt;&lt;SPAN&gt;as? &lt;/SPAN&gt;SharedFlow)?.collect &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;/*handle the onSingleTapConfirmed Event*/&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            (&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;onUp &lt;/SPAN&gt;&lt;SPAN&gt;as? &lt;/SPAN&gt;SharedFlow)?.collect &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;/*handle the onUp Event*/&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;launch &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            (&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;onDown &lt;/SPAN&gt;&lt;SPAN&gt;as? &lt;/SPAN&gt;SharedFlow)?.collect &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;/*handle the onDown Event*/&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    }&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But still not sure how to handle the OnMove event when&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;mapView&lt;/SPAN&gt;.&lt;SPAN&gt;interactionOptions&lt;/SPAN&gt;.&lt;SPAN&gt;isPanEnabled &lt;/SPAN&gt;= false&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 09:36:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1294899#M58</guid>
      <dc:creator>GPK</dc:creator>
      <dc:date>2023-06-01T09:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1295793#M61</link>
      <description>&lt;P&gt;Hi GPK, It's good that you've figured out how to collect `onSingleTapConfirmed`, `onDown` and `onUp` at the same time. To handle move events you need to subscribe to `onPan`.&lt;/P&gt;&lt;P&gt;You could add to your example code as follows:&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;launch { mapView.onPan.collect { /* handle pan/move events */ } }&lt;/LI-CODE&gt;&lt;P&gt;Note that you don't need to cast the event to a SharedFlow in order to use it.&lt;/P&gt;&lt;P&gt;I believe the onPan event should work even if `isPanEnabled` is set to false.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 13:57:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1295793#M61</guid>
      <dc:creator>FPearson</dc:creator>
      <dc:date>2023-06-05T13:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1295838#M62</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546527"&gt;@FPearson&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;Unfortunately, the PanChangeEvent is not worked in my case when&lt;SPAN&gt;`&lt;STRONG&gt;isPanEnabled&lt;/STRONG&gt;` is set to &lt;STRONG&gt;false&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;The co-ordinates it gives the top left corner point always even when I performed the OnDown action in the center of the mapView and dragged it towards the bottom right to plot a square box to identify the features that fall under the square box(envelope). But it plotted from OnDown point to the top left corner of the mapview.&lt;/P&gt;&lt;P&gt;I mean the &lt;STRONG&gt;panChangeEvent.motion.x&lt;/STRONG&gt; and &lt;STRONG&gt;panChangeEvent.motion.y&lt;/STRONG&gt; those coordinates always falls on the top left edge of Mapview&amp;nbsp;&lt;SPAN&gt;instead of following the drag coordinates.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please find the screenshot that we supported in 100.x version with&amp;nbsp;DefaultMapViewOnTouchListener.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 15:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1295838#M62</guid>
      <dc:creator>GPK</dc:creator>
      <dc:date>2023-06-05T15:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1297600#M72</link>
      <description>&lt;P&gt;Hi GPK,&lt;/P&gt;&lt;P&gt;Note that these coordinates tell you the offset from the previous pan event, not the absolute position of the event on the screen. I think this is why you are seeing lots of x and y values near zero -- this just means that the event happened very close to where the previous event happened (note that you will probably receive 100s of pan events for one pan gesture).&lt;/P&gt;&lt;P&gt;I think the easiest approach to creating the feature you're looking for is to use the coordinates from the `onDown` event as one corner of the envelope and the coordinates from `onUp` as the other corner. Another possibility is to add up all the x and y values that you get from `onPan` to calculate the total x and y movement and add that to the starting coordinates that you get from `onDown`. I hope that helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 14:40:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1297600#M72</guid>
      <dc:creator>FPearson</dc:creator>
      <dc:date>2023-06-09T14:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1299036#M75</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;again for the response &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/546527"&gt;@FPearson&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;You have almost shown me a way with onUp and onDown coordinates, I can use the area of geometry and find the features that fall under it. But the visual representation on the ACTION_MOVE is still not achievable with those SharedFlows.&lt;/P&gt;&lt;P&gt;I found a workaround with a Transparent Temp View on top of the MapView. The&amp;nbsp; MapView and TempView should have the same layout dimensions and added the &lt;STRONG&gt;onTouchListener&lt;/STRONG&gt; to the &lt;STRONG&gt;TempView.&amp;nbsp;&lt;/STRONG&gt;Based on the screen coordinates that I get from the TempView's touchListener converted it to &lt;STRONG&gt;Point&lt;/STRONG&gt; by using&lt;STRONG&gt;&amp;nbsp;mapView.screenToLocation&amp;nbsp;&lt;/STRONG&gt;like below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MotionEvent.&lt;SPAN&gt;ACTION_MOVE &lt;/SPAN&gt;-&amp;gt; {&lt;BR /&gt;    &lt;SPAN&gt;val &lt;/SPAN&gt;p: Point? = &lt;SPAN&gt;mapView&lt;/SPAN&gt;.screenToLocation(&lt;BR /&gt;        ScreenCoordinate(&lt;SPAN&gt;event&lt;/SPAN&gt;.&lt;SPAN&gt;x&lt;/SPAN&gt;.toDouble()&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;event&lt;/SPAN&gt;.&lt;SPAN&gt;y&lt;/SPAN&gt;.toDouble())&lt;BR /&gt;    )&lt;BR /&gt;    // Plotted the envelope box here&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;With this, the use case got achieved.&lt;/P&gt;&lt;P&gt;Thanks again for the valuable time, ideas, and suggestions.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 07:46:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1299036#M75</guid>
      <dc:creator>GPK</dc:creator>
      <dc:date>2023-06-14T07:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I handle the DefaultMapViewOnTouchListener.OnTouch event's Action.Up, Action.Down and Action.Move with Kotlin Maps SDK Android</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1299054#M77</link>
      <description>&lt;P&gt;Great idea -- I'm glad that you got it working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 08:48:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/how-do-i-handle-the-defaultmapviewontouchlistener/m-p/1299054#M77</guid>
      <dc:creator>FPearson</dc:creator>
      <dc:date>2023-06-14T08:48:25Z</dc:date>
    </item>
  </channel>
</rss>

