Not all of my Runtime users have internal GPS yet, and while porting my serial GPS code from 10.2.7 to 100.1, I've noticed an odd quirk. When the location display is first enabled by the application, it doesn't always display the valid locations coming in. Disabling and re-enabling fixes the problem, so as a workaround I added this snippet after the first valid point is collected and sent to the display:
_ld.IsEnabled = false; Thread.Sleep(100); _ld.IsEnabled = true;
Has anyone else seen this?
That's hard to say. It could be the custom implementation. Can you share your GPS implementation?
Here's another example of a custom GPS location provider for reference:
A few theories...
You might risk the device is getting started twice. The second call to InitializeAsync should return the same task (you don't really need to use Task.Factory.StartNew though, since all your start code is synchronous).
Same goes for StopAsync
You're replacing the LocationChanged event. I'm not sure why you do that? The base event will raise when you call 'base.UpdateLocation'.
I'm curious what problems you were having with the 100.x sample. Did you configure it with the right port settings?
I use tasks to help keep the app from locking. Good call on LocationChanged -- I was still thinking in terms of ILocationProvider. Even after renaming it, though, the point display problem persists.
Re your example, I tracked it to horizontal accuracy is NaN, which the location constructor doesn't accept. I ran into that problem myself, and substitute 0 on those occasions. I updated the example on my end and it works now.
Looks like one workaround is to set the velocity to a non-zero number (e.g. 0.1). Of course, that affects which symbol is displayed. [If I set UseCourseSymbolOnMovement to false, the problem persists.]