ThinkGeo.com    |     Documentation    |     Premium Support

Refresh UI while updating GPS data

Hi!

I’m a newbie using ThinkGeo. I’m creating a very simple app that reads $GPGGA from a GPS and shows a point on the map. I’ve used gmap before doing the same thing, but i’m not capable of make it working here. In this app, i have two buttons, one for opening the COM3 port and other for closing it. When open, i read the stream and call an async dispatcher that reads the string and process it, reading the coords and making a new PointShape with them. When it’s processed, i call mapView.RefreshAsync on the points overlay only. The problem is that when i execute this, the map view freezes. I can zoom in and zoom out but it doesn’t show anything until i hit the stop button, in that moment the point shows, the map shows and everything is normal except for, of course, that point is never going to update position.

I tried all morning to make it work but it seems imposible for me to understand the problem and can’t find any good info online.

Thank you for your time, maybe this is quite simple but i am not capable!

Hi,

Can hard cod the point instead of getting it from GPS, see if the map works correctly?
1 if it doesn’t work, there’s some issue in displaying the point. Please check out the following sample if you are adding a marker
samples/wpf/HowDoISample/Samples/MarkersandPopups/Markers.xaml.cs · master · ThinkGeo / Public / Desktop Maps · GitLab
Here is an example showing how to apply animation to markers so you can have the breathing effect for your GPS point
samples/wpf/HowDoISample/Samples/MarkersandPopups/AnimatedMarker.xaml.cs · develop · ThinkGeo / Public / Desktop Maps · GitLab

2, if it works with hard coded point but not working with GPS point, please check out this sample about how to get the point from GPS. This is MAUI Code so might not 100% match your scenario.
HowDoISample/Samples/MapNavigation/Navigation.xaml.cs · develop · ThinkGeo / Public / Mobile Maps · GitLab

Hope that helps.

Thanks,
Ben