Skip to content
Permalink
Browse files
Fix 0 coords in gps feature capturing (appears sometimes when loosing…
… gps connection)

git-svn-id: http://svn.osgeo.org/qgis/trunk@13737 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 16, 2010
1 parent 9d3649b commit 8038b8567183ec77d94d4249f970397220b1531a
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/app/gps/qgsgpsinformationwidget.cpp
@@ -418,7 +418,18 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
mpPlot->replot();
if ( mpMapMarker )
delete mpMapMarker;
QgsPoint myNewCenter = QgsPoint( info.longitude, info.latitude );

//after loosing connection, the first gps info sometimes has uninitialized coords
QgsPoint myNewCenter;
if( doubleNear( info.longitude, 0.0 ) && doubleNear( info.latitude, 0.0) )
{
myNewCenter = mLastGpsPosition;
}
else
{
myNewCenter = QgsPoint( info.longitude, info.latitude );
}

if ( mGroupShowMarker->isChecked() )
{
mpMapMarker = new QgsGpsMarker( mpCanvas );

0 comments on commit 8038b85

Please sign in to comment.