<?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: Issues with iOS (Xamarin Forms) starting location data source in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/issues-with-ios-xamarin-forms-starting-location/m-p/1072243#M10211</link>
    <description>&lt;P&gt;I've seen a similar error (or maybe the same one).&amp;nbsp; I have never truly tracked it down, based on description appears it wants to try to start the location data source a second time.&amp;nbsp; Not sure if you are just using on board location or have external.&lt;/P&gt;&lt;P&gt;A couple things I have done, is when using an external GPS I make sure to set the LocationDisplay.DataSource on the main thread&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//LocationProvider.LocationDataSource is a pointer to an external custom LocationDataSource
MainThread.BeginInvokeOnMainThread(() =&amp;gt; mapView.LocationDisplay.DataSource = LocationProvider.LocationDataSource);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Also make sure to wrap starting in a conditional, to be sure that we don't send a StartAsync after it's running&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if ( !mapView.LocationDisplay.DataSource.IsStarted )
{
	mapView.LocationDisplay.IsEnabled = true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Good luck&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 19:27:27 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2021-06-24T19:27:27Z</dc:date>
    <item>
      <title>Issues with iOS (Xamarin Forms) starting location data source</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/issues-with-ios-xamarin-forms-starting-location/m-p/1072045#M10204</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We've been seeing a very sporadic issue on iOS when an app starts the location data source resulting in an unhandled exception. It's only happened a few times but we'd like to get to the bottom of it. We're not sure where it is coming from so we figured we post something here to see if anyone had any ideas.&lt;/P&gt;&lt;P&gt;Any input would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Here's the exception and stack trace we get when the error occurs:&lt;/P&gt;&lt;P&gt;Invalid argument: location data source has been started.&lt;/P&gt;&lt;P&gt;ArcGISException.HandleCoreError (RuntimeCoreNet.GeneratedWrappers.CoreError error, System.Boolean throwException)&lt;BR /&gt;Interop.CheckError (System.IntPtr errorHandle, System.Boolean throwOnFailure, System.Runtime.InteropServices.GCHandle wrapperHandle)&lt;BR /&gt;CoreLocationDataSource.HandleStart (RuntimeCoreNet.GeneratedWrappers.CoreClientReference userDefinedError)&lt;BR /&gt;ICoreCallback_LocationDataSource_StartCallback.StartCallback ()&lt;BR /&gt;AsyncMethodBuilderCore+&amp;lt;&amp;gt;c.&amp;lt;ThrowAsync&amp;gt;b__7_0 (System.Object state)&lt;BR /&gt;NSAsyncSynchronizationContextDispatcher.Apply ()&lt;BR /&gt;(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)&lt;BR /&gt;UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate)&lt;BR /&gt;UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)&lt;BR /&gt;Application.Main (System.String[] args)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:00:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/issues-with-ios-xamarin-forms-starting-location/m-p/1072045#M10204</guid>
      <dc:creator>MichaelHamsa</dc:creator>
      <dc:date>2021-06-24T15:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with iOS (Xamarin Forms) starting location data source</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/issues-with-ios-xamarin-forms-starting-location/m-p/1072243#M10211</link>
      <description>&lt;P&gt;I've seen a similar error (or maybe the same one).&amp;nbsp; I have never truly tracked it down, based on description appears it wants to try to start the location data source a second time.&amp;nbsp; Not sure if you are just using on board location or have external.&lt;/P&gt;&lt;P&gt;A couple things I have done, is when using an external GPS I make sure to set the LocationDisplay.DataSource on the main thread&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//LocationProvider.LocationDataSource is a pointer to an external custom LocationDataSource
MainThread.BeginInvokeOnMainThread(() =&amp;gt; mapView.LocationDisplay.DataSource = LocationProvider.LocationDataSource);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Also make sure to wrap starting in a conditional, to be sure that we don't send a StartAsync after it's running&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if ( !mapView.LocationDisplay.DataSource.IsStarted )
{
	mapView.LocationDisplay.IsEnabled = true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Good luck&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 19:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/issues-with-ios-xamarin-forms-starting-location/m-p/1072243#M10211</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-06-24T19:27:27Z</dc:date>
    </item>
  </channel>
</rss>

