We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d3649b commit 8038b85Copy full SHA for 8038b85
src/app/gps/qgsgpsinformationwidget.cpp
@@ -418,7 +418,18 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
418
mpPlot->replot();
419
if ( mpMapMarker )
420
delete mpMapMarker;
421
- QgsPoint myNewCenter = QgsPoint( info.longitude, info.latitude );
+
422
+ //after loosing connection, the first gps info sometimes has uninitialized coords
423
+ QgsPoint myNewCenter;
424
+ if( doubleNear( info.longitude, 0.0 ) && doubleNear( info.latitude, 0.0) )
425
+ {
426
+ myNewCenter = mLastGpsPosition;
427
+ }
428
+ else
429
430
+ myNewCenter = QgsPoint( info.longitude, info.latitude );
431
432
433
if ( mGroupShowMarker->isChecked() )
434
{
435
mpMapMarker = new QgsGpsMarker( mpCanvas );
0 commit comments