<?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: Setting AutoPanMode with Custom LocationDataSource Error in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/setting-autopanmode-with-custom-locationdatasource/m-p/702069#M8868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your custom &lt;EM&gt;LocationDataSource&lt;/EM&gt; calls the base class &lt;EM&gt;UpdateLocation&lt;/EM&gt; method with a valid coordinate. If an invalid coordinate like:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;var coord = new MapPoint(double.NaN, double.NaN, spatialReference)&lt;/BLOCKQUOTE&gt;&lt;P&gt;is passed to &lt;EM&gt;UpdateLocation&lt;/EM&gt;, you'll get an error similar to what you're seeing. This tends to happen before external GPS or compass devices are fully initialized, so just check your coordinate before calling &lt;EM&gt;UpdateLocation&lt;/EM&gt; and it may fix your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Sep 2017 23:21:57 GMT</pubDate>
    <dc:creator>GregDeStigter</dc:creator>
    <dc:date>2017-09-11T23:21:57Z</dc:date>
    <item>
      <title>Setting AutoPanMode with Custom LocationDataSource Error</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setting-autopanmode-with-custom-locationdatasource/m-p/702068#M8867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we're using WPF Runtime 100.1 SDK. &amp;nbsp;We want to make use of the LocationDisplay on a map view to track locations on the map. &amp;nbsp;By default the datasource of the LocationDisplay is of type&amp;nbsp;&lt;SPAN style="color: #000000;"&gt;SystemLocationDataSource which works as expected. &amp;nbsp;&lt;SPAN&gt;SystemLocationDataSource inherits from&amp;nbsp;LocationDataSource which is an abstract class. &amp;nbsp;Instead of using&amp;nbsp;SystemLocationDataSource we have created our own custom class which inherits from&amp;nbsp;LocationDataSource. &amp;nbsp;Upon setting a valid location, we want to change the AutoPanMode. &amp;nbsp;&amp;nbsp;LocationDisplayAutoPanMode.Recenter and&amp;nbsp;LocationDisplayAutoPanMode.Off works as expected. &amp;nbsp;However, setting auto pan mode to LocationDisplayAutoPanMode.Navigation results in the following error:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #000000;"&gt;System.ArgumentException occurred&lt;BR /&gt; HResult=0x80070057&lt;BR /&gt; Message=Invalid argument: Target Extent is empty.&lt;BR /&gt; Source=Esri.ArcGISRuntime&lt;BR /&gt; StackTrace:&lt;BR /&gt; at Esri.ArcGISRuntime.ArcGISException.HandleCoreError(CoreError error, Boolean throwException)&lt;BR /&gt; at RuntimeCoreNet.GeneratedWrappers.Interop.CheckError(IntPtr errorHandle, Boolean throwOnFailure, GCHandle wrapperHandle)&lt;BR /&gt; at RuntimeCoreNet.GeneratedWrappers.CoreGeoView.GetCurrentViewpoint(CoreViewpointType viewpointType)&lt;BR /&gt; at Esri.ArcGISRuntime.UI.Controls.GeoView.GetCurrentViewpoint(ViewpointType viewpointType)&lt;BR /&gt; at Esri.ArcGISRuntime.UI.Controls.GeoView.&amp;lt;ArrangeViewOverlays&amp;gt;b__179_0()&lt;BR /&gt; at Esri.ArcGISRuntime.UI.Controls.GeoView.RunOnDispatcher(Action action)&lt;BR /&gt; at Esri.ArcGISRuntime.UI.Controls.GeoView.ArrangeViewOverlays()&lt;BR /&gt; at Esri.ArcGISRuntime.UI.Controls.GeoView.OnRaiseViewpointChanged()&lt;BR /&gt; at Esri.ArcGISRuntime.UI.Controls.MapView.OnRaiseViewpointChanged()&lt;BR /&gt; at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)&lt;BR /&gt; at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate &lt;BR /&gt;catchHandler)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;I have tried this in a sample ESRI has provided&amp;nbsp;on how to use the LocationDisplay property on a map view. &amp;nbsp;The only thing I changed was the datasource on the LocationDisplay from&amp;nbsp;SystemLocationDataSource to our custom class derived from LocationDataSource. &amp;nbsp;Based on the error above, behind the scenes the LocationDisplay appears to be using the&amp;nbsp;GetCurrentViewpoint method which is a method on the map view. &amp;nbsp;I have tried calling this method as the map view has changed going to the navigation auto pan mode. &amp;nbsp;I get the exact same error. &amp;nbsp;Are there any special conditions that need to be set on a derived&amp;nbsp;LocationDataSource class?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setting-autopanmode-with-custom-locationdatasource/m-p/702068#M8867</guid>
      <dc:creator>MichaelMorton</dc:creator>
      <dc:date>2017-08-31T21:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Setting AutoPanMode with Custom LocationDataSource Error</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/setting-autopanmode-with-custom-locationdatasource/m-p/702069#M8868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your custom &lt;EM&gt;LocationDataSource&lt;/EM&gt; calls the base class &lt;EM&gt;UpdateLocation&lt;/EM&gt; method with a valid coordinate. If an invalid coordinate like:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;var coord = new MapPoint(double.NaN, double.NaN, spatialReference)&lt;/BLOCKQUOTE&gt;&lt;P&gt;is passed to &lt;EM&gt;UpdateLocation&lt;/EM&gt;, you'll get an error similar to what you're seeing. This tends to happen before external GPS or compass devices are fully initialized, so just check your coordinate before calling &lt;EM&gt;UpdateLocation&lt;/EM&gt; and it may fix your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 23:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/setting-autopanmode-with-custom-locationdatasource/m-p/702069#M8868</guid>
      <dc:creator>GregDeStigter</dc:creator>
      <dc:date>2017-09-11T23:21:57Z</dc:date>
    </item>
  </channel>
</rss>

