We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent c19fd0d commit 52f985cCopy full SHA for 52f985c
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