<?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: Device Location data when data source is WiFi in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121453#M10673</link>
    <description>&lt;P&gt;I've been unable to reproduce the issue, so I'm fairly certain it is device/driver specific. Here's an example of creating a datasource that uses the existing datasource and performs some simple location filtering:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public class FilteredLocationDatasource : LocationDataSource
    {
        private readonly LocationDataSource internalDatasource = new SystemLocationDataSource();
        public FilteredLocationDatasource()
        {
            internalDatasource.LocationChanged += InternalDatasource_LocationChanged;
            internalDatasource.HeadingChanged += InternalDatasource_HeadingChanged;
        }

        private void InternalDatasource_HeadingChanged(object sender, double e) =&amp;gt; base.UpdateHeading(e)

        private void InternalDatasource_LocationChanged(object sender, Location e)
        {
            if (e.Position.X != 0 &amp;amp;&amp;amp; e.Position.Y != 0)
                base.UpdateLocation(e);
        }

        protected override Task OnStartAsync() =&amp;gt; internalDatasource.StartAsync();
        protected override Task OnStopAsync() =&amp;gt; internalDatasource.StopAsync();
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 21:14:05 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2021-11-30T21:14:05Z</dc:date>
    <item>
      <title>Device Location data when data source is WiFi</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121186#M10669</link>
      <description>&lt;P&gt;Hi all, I wondered if anybody could help me.&lt;/P&gt;&lt;P&gt;We are building a UWP app (using runtime 100.12) and experimenting with the Device location functionality to plot the user's position on a map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is on Windows, so using the Windows Location Service to provide the data. If there is no GPS device available, Windows will revert to WiFi to provide the approximate location.&lt;/P&gt;&lt;P&gt;However we've noticed that in this case the Esri device location reports a position of 0,0 most of the time, occasionally showing the approximate location, and the AdditionalSourceProperties says the source is "GNSS".&lt;/P&gt;&lt;P&gt;However if we use the native Windows Geolocation API, we get a correct position and a source of "Wifi".&lt;/P&gt;&lt;P&gt;Subscribing to the LocationChanged event, we can see the repeated 0,0 with the odd correct position thrown in:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:15:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:16:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:16:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:17:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:18:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:18:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:18:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:19:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:20:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:20:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:21:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:21:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:22:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:22:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:23:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:23:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:24:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:24:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:25:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:25:MapPoint[X=0.51206589, Y=51.273515, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:26:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:27:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:27:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;30/11/2021 11:05:28:MapPoint[X=0, Y=0, Z=0, Wkid=4326]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I just wondered if this was deliberate or if there is something we can do to get the Esri device location to consistently use the Wifi position if that is all that is available.&lt;/P&gt;&lt;P&gt;The other thing I wondered was how come the locationChanged event is firing twice a second when the position remains at 0,0.&lt;/P&gt;&lt;P&gt;Hope this makes sense and somebody can point me in the right direction.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 11:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121186#M10669</guid>
      <dc:creator>jamc_70</dc:creator>
      <dc:date>2021-11-30T11:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Device Location data when data source is WiFi</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121318#M10670</link>
      <description>&lt;P&gt;Thank you for reporting this. The underlying datasource used for location is the Geolocator, so it should be identical. I double-checked our code and if&amp;nbsp;geoposition.Coordinate.PositionSource == PositionSource.WiFi it should say "WIFI", and only if PositionSource.Satellite it should say GNSS.&lt;BR /&gt;&lt;BR /&gt;How are you creating the geolocator you used for comparison? I wonder if you're seeing different behavior on different ways of creating it? Here's the equivalent settings the runtime uses:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;new Geolocator()
{
  DesiredAccuracy = PositionAccuracy.High,
  MovementThreshold = 0,
  ReportInterval = 1000,
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;The other thing I wondered was how come the locationChanged event is firing twice a second when the position remains at 0,0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;There might be other things changing, like accuracy, elevation, heading, speed etc.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 17:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121318#M10670</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2021-11-30T17:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Device Location data when data source is WiFi</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121343#M10671</link>
      <description>&lt;P&gt;Thanks Morten for your reply and the information.&lt;/P&gt;&lt;P&gt;Yes you're right.&amp;nbsp;We were setting the accuracy to default when creating the GeoLocator. If I changed this to High then the Geolocator started publishing LocationChanged events every second with source="Satellite" but 0,0 coords just like the Esri component was, and when it occasionally emits an actual location, the positionSource changed to "WiFi".&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it seems that if you set the positionaccuracy to High the Windows geolocator emits a 0,0 coord constantly (with source=satellite) until it occasionally gets a WiFi based coordinate, whereupon it emits that instead.&lt;/P&gt;&lt;P&gt;So here you can see where I'm writing out both as they publish their respective events:&lt;/P&gt;&lt;PRE&gt;Geolocator:X=0,Y=0,PositionSource=Satellite&lt;BR /&gt;Geolocator:X=0.51206589,Y=51.273515,PositionSource=WiFi&lt;BR /&gt;Geolocator:X=0.51206589,Y=51.273515,PositionSource=WiFi&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;Geolocator:X=0.51206589,Y=51.273515,PositionSource=WiFi&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0.51206589, Y=51.273515, Z=0, Wkid=4326], positionSource=WIFI&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;BR /&gt;EsriDeviceLocation:MapPoint[X=0, Y=0, Z=0, Wkid=4326], positionSource=GNSS&lt;/PRE&gt;&lt;P&gt;The problem for us here is that we don't really want to show this on the map, as if we are using the autopan mode it zooms us to somewhere a long way away from our map (which is just the SE of England).&lt;/P&gt;&lt;P&gt;Is there a way to configure your device location to not show if the coords are being reported as 0,0?&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 17:53:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121343#M10671</guid>
      <dc:creator>jamc_70</dc:creator>
      <dc:date>2021-11-30T17:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Device Location data when data source is WiFi</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121350#M10672</link>
      <description>&lt;P&gt;In that case, this sounds like a location driver issue on your device. You might want to check for updated drivers or reach out to the hardware manufacturer.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 17:58:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121350#M10672</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2021-11-30T17:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Device Location data when data source is WiFi</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121453#M10673</link>
      <description>&lt;P&gt;I've been unable to reproduce the issue, so I'm fairly certain it is device/driver specific. Here's an example of creating a datasource that uses the existing datasource and performs some simple location filtering:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public class FilteredLocationDatasource : LocationDataSource
    {
        private readonly LocationDataSource internalDatasource = new SystemLocationDataSource();
        public FilteredLocationDatasource()
        {
            internalDatasource.LocationChanged += InternalDatasource_LocationChanged;
            internalDatasource.HeadingChanged += InternalDatasource_HeadingChanged;
        }

        private void InternalDatasource_HeadingChanged(object sender, double e) =&amp;gt; base.UpdateHeading(e)

        private void InternalDatasource_LocationChanged(object sender, Location e)
        {
            if (e.Position.X != 0 &amp;amp;&amp;amp; e.Position.Y != 0)
                base.UpdateLocation(e);
        }

        protected override Task OnStartAsync() =&amp;gt; internalDatasource.StartAsync();
        protected override Task OnStopAsync() =&amp;gt; internalDatasource.StopAsync();
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 21:14:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121453#M10673</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2021-11-30T21:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Device Location data when data source is WiFi</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121619#M10675</link>
      <description>&lt;P&gt;OK Morten thanks for the device driver suggestion, I will look into that, and for the sample code, that is most useful.&lt;/P&gt;&lt;P&gt;Thanks for your time and effort helping with this, it is much appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 08:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/device-location-data-when-data-source-is-wifi/m-p/1121619#M10675</guid>
      <dc:creator>jamc_70</dc:creator>
      <dc:date>2021-12-01T08:29:42Z</dc:date>
    </item>
  </channel>
</rss>

