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/qgis@13737 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 16, 2010
1 parent c19fd0d commit 52f985c5a6f65453300e96b51ba3f4dbd826cf97
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 52f985c

Please sign in to comment.