diff options
author | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-04-11 01:04:21 +0100 |
---|---|---|
committer | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-04-11 01:17:38 +0100 |
commit | 7d44e3c589b92d6e4a6f330095f0598f097f234b (patch) | |
tree | a7f915290a3fadd0d5d1458b807850901ad30a27 /src/gclue-modem-gps.c | |
parent | 078ff5fdfdfddfa434bdba19624ab20f660c0096 (diff) | |
download | geoclue-7d44e3c589b92d6e4a6f330095f0598f097f234b.tar.gz |
modem-gps: Expose altitude of location
Diffstat (limited to 'src/gclue-modem-gps.c')
-rw-r--r-- | src/gclue-modem-gps.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gclue-modem-gps.c b/src/gclue-modem-gps.c index e3cec30..646982c 100644 --- a/src/gclue-modem-gps.c +++ b/src/gclue-modem-gps.c @@ -167,7 +167,7 @@ on_get_gps_nmea_ready (GObject *source_object, MMModemLocation *modem_location = MM_MODEM_LOCATION (source_object); MMLocationGpsNmea *location_nmea; GeocodeLocation *location; - gdouble latitude, longitude, accuracy; + gdouble latitude, longitude, accuracy, altitude; GError *error = NULL; location_nmea = mm_modem_location_get_gps_nmea_finish (modem_location, @@ -187,12 +187,15 @@ on_get_gps_nmea_ready (GObject *source_object, latitude = mm_location_gps_raw_get_latitude (priv->gps_raw); longitude = mm_location_gps_raw_get_longitude (priv->gps_raw); + altitude = mm_location_gps_raw_get_altitude (priv->gps_raw); g_clear_object (&priv->gps_raw); accuracy = get_accuracy_from_nmea (source, location_nmea); g_object_unref (location_nmea); location = geocode_location_new (latitude, longitude, accuracy); + if (altitude != MM_LOCATION_ALTITUDE_UNKNOWN) + g_object_set (location, "altitude", altitude, NULL); gclue_location_source_set_location (GCLUE_LOCATION_SOURCE (source), location); } |