From fe1c07f091dc9dfb7f5adda8a6569d729c1baebc Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Tue, 15 Nov 2011 20:41:32 +0300 Subject: Closed #347 - check for invalid rect and location --- platform/wifi_location_service.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'platform/wifi_location_service.cpp') diff --git a/platform/wifi_location_service.cpp b/platform/wifi_location_service.cpp index 9e7ceedfd7..dfd6beecf9 100644 --- a/platform/wifi_location_service.cpp +++ b/platform/wifi_location_service.cpp @@ -42,12 +42,15 @@ namespace location GpsInfo info; info.m_latitude = json_real_value(lat); info.m_longitude = json_real_value(lon); - info.m_horizontalAccuracy = json_real_value(acc); - // @TODO introduce flags to mark valid values - info.m_timestamp = static_cast(time(NULL)); - info.m_source = location::EGoogle; - m_observer.OnGpsUpdated(info); - success = true; + if (IsLatValid(info.m_latitude) && IsLonValid(info.m_latitude)) + { + info.m_horizontalAccuracy = json_real_value(acc); + // @TODO introduce flags to mark valid values + info.m_timestamp = static_cast(time(NULL)); + info.m_source = location::EGoogle; + m_observer.OnGpsUpdated(info); + success = true; + } } } } -- cgit v1.2.3