<?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 mapView.identifyLayer outside of touch event? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602975#M5294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom view that sits on top of the map that has a list of misc images (a toolbar of sorts). Each image has the ability to be dragged across the screen and then wherever they drop the image, I would like to be able to perform the mapView.identifyLayer method to identify/read layer data from the screen point where the drop occurred. &amp;nbsp;When this method is called outside of a touch event, it goes into the function, but it never returns with a completion. &amp;nbsp;It hangs forever. &amp;nbsp;The same code works fine when called inside the geoView 'didTapAtScreenPoint' event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/461067_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Oct 2019 17:00:58 GMT</pubDate>
    <dc:creator>TravisYordi</dc:creator>
    <dc:date>2019-10-03T17:00:58Z</dc:date>
    <item>
      <title>mapView.identifyLayer outside of touch event?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602975#M5294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom view that sits on top of the map that has a list of misc images (a toolbar of sorts). Each image has the ability to be dragged across the screen and then wherever they drop the image, I would like to be able to perform the mapView.identifyLayer method to identify/read layer data from the screen point where the drop occurred. &amp;nbsp;When this method is called outside of a touch event, it goes into the function, but it never returns with a completion. &amp;nbsp;It hangs forever. &amp;nbsp;The same code works fine when called inside the geoView 'didTapAtScreenPoint' event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/461067_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 17:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602975#M5294</guid>
      <dc:creator>TravisYordi</dc:creator>
      <dc:date>2019-10-03T17:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: mapView.identifyLayer outside of touch event?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602976#M5295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you are calling self.mapView.identifyLayer() from the main thread, and so I'm pretty sure that what's happening is that you're blocking the main thread with your &lt;STRONG&gt;group.wait()&lt;/STRONG&gt; call and then the mapView is blocked when it tries to call&amp;nbsp;back into your completion closure.&amp;nbsp;&amp;nbsp;You can learn more about Runtime and threading here:&amp;nbsp;&lt;A href="https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-ios/blog/2019/01/19/threading-and-the-ios-runtime-sdk"&gt;https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-ios/blog/2019/01/19/threading-and-the-ios-runtime-sdk&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than forcing a synchronous pattern into your function, you should define &lt;STRONG&gt;getFeatureDataAtLocation()&lt;/STRONG&gt; with a callback method too. See &lt;A _jive_internal="true" href="https://community.esri.com/thread/240696-how-to-wait-and-get-results-out-completion-of-featuretablequeryfeatures#comment"&gt;my answer&lt;/A&gt; to a not entirely unrelated question from yesterday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps one day Swift will finally &lt;A href="https://gist.github.com/lattner/429b9070918248274f25b714dcfc7619"&gt;adopt async&lt;/A&gt; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;but until then you should use this pattern.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 19:39:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602976#M5295</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2019-10-03T19:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: mapView.identifyLayer outside of touch event?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602977#M5296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're absolutely right... I'm a bonehead : ) &amp;nbsp;I do get results when I add a callback/completion to getFeatureDataAtLocation().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 14:15:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/mapview-identifylayer-outside-of-touch-event/m-p/602977#M5296</guid>
      <dc:creator>TravisYordi</dc:creator>
      <dc:date>2019-10-04T14:15:06Z</dc:date>
    </item>
  </channel>
</rss>

