<?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 to get AGSNMEALocation from AGSNMEALocationDataSource in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056312#M6990</link>
    <description>&lt;P&gt;Thank you so much, I appreciate the help.&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 17:28:32 GMT</pubDate>
    <dc:creator>WyattHarrell</dc:creator>
    <dc:date>2021-05-10T17:28:32Z</dc:date>
    <item>
      <title>How to get AGSNMEALocation from AGSNMEALocationDataSource</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056306#M6988</link>
      <description>&lt;P data-unlink="true"&gt;&lt;SPAN&gt;I am attempting to use the initializer&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;initWithEAAccessory:protocol:&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;and the&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;locationDataSource:locationDidChange&lt;STRONG&gt;:&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;method for the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_n_m_e_a_location_data_source.html" target="_self"&gt;AGSNMEALocationDataSource&lt;/A&gt;&lt;/STRONG&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;The documentation for &lt;EM&gt;AGSNMEALocationDataSource&lt;/EM&gt; states that “the&amp;nbsp;&lt;EM&gt;locationDataSource:locationDidChange: (AGSLocationChangeHandlerDelegate-p)&lt;/EM&gt;&amp;nbsp;method will return an&amp;nbsp;&lt;EM&gt;AGSNMEALocation&lt;/EM&gt;,” but&amp;nbsp;&lt;SPAN&gt;after conforming to the&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;AGSNMEALocationDataSourceDelegate&lt;/EM&gt;&amp;nbsp;the method actually returns a &lt;EM&gt;AGSLocation&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;instead.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;How can I access the&amp;nbsp;&lt;EM&gt;AGSNMEALocation&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;class SomeClassName: AGSLocationChangeHandlerDelegate {

    func locationDataSource(_ locationDataSource: AGSLocationDataSource, locationDidChange location: AGSLocation) {

        // This delegate method gives back an AGSLocation instead of the needed AGSNMEALocation as stated in the documentation

    }

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 17:13:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056306#M6988</guid>
      <dc:creator>WyattHarrell</dc:creator>
      <dc:date>2021-05-10T17:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get AGSNMEALocation from AGSNMEALocationDataSource</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056308#M6989</link>
      <description>&lt;P&gt;Hi Wyatt,&lt;/P&gt;&lt;P&gt;You can safely downcast the `AGSLocation` type to `AGSNMEALocation` with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```swift&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pl-k"&gt;guard&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;let&lt;/SPAN&gt;&lt;SPAN&gt; nmeaLocation &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; location &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;as?&lt;/SPAN&gt;&lt;SPAN&gt; AGSNMEALocation &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; { &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;Reason:&lt;/P&gt;&lt;P&gt;The NMEA delegate method inherits from the `&lt;SPAN&gt;AGSLocationChangeHandlerDelegate`... But I'll let our team know that the API design here is a bit confusing, and maybe we can add another `AGSNMEALocation` specific stub in the delegate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;References:&lt;/P&gt;&lt;P&gt;- &lt;A href="https://github.com/Esri/arcgis-runtime-samples-ios/blob/fe49f1ebdbbba50661aa791c8d53ae58f169134a/arcgis-ios-sdk-samples/Maps/Display%20device%20location%20with%20NMEA%20data%20sources/DisplayDeviceLocationWithNMEADataSourcesViewController.swift#L219" target="_blank" rel="noopener"&gt;Sample code&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_n_m_e_a_location.html" target="_self"&gt;AGSNMEALocation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/protocol_a_g_s_n_m_e_a_location_data_source_delegate-p.html" target="_self"&gt;&lt;SPAN&gt;AGSNMEALocationDataSourceDelegate&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 17:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056308#M6989</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2021-05-10T17:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get AGSNMEALocation from AGSNMEALocationDataSource</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056312#M6990</link>
      <description>&lt;P&gt;Thank you so much, I appreciate the help.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 17:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-get-agsnmealocation-from/m-p/1056312#M6990</guid>
      <dc:creator>WyattHarrell</dc:creator>
      <dc:date>2021-05-10T17:28:32Z</dc:date>
    </item>
  </channel>
</rss>

