[gnome-maps] placeBubble: Show altitudes below sea level



commit 01f234566049a977368bdf0c70c9c5a8c18eaf13
Author: James Westman <james flyingpimonster net>
Date:   Tue Aug 25 14:00:50 2020 -0500

    placeBubble: Show altitudes below sea level

 src/placeBubble.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/placeBubble.js b/src/placeBubble.js
index 2e59fc8f..e205cc0b 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -273,7 +273,9 @@ var PlaceBubble = GObject.registerClass({
                            info: parseInt(place.population).toLocaleString() });
         }
 
-        if (place.location.altitude > 0) {
+        /* The default value for a place's altitude is -G_MAXDOUBLE, so we can
+         * compare to an impossibly low altitude to see if one is set */
+        if (place.location.altitude > -1000000000.0) {
             let alt  = place.location.altitude;
             content.push({ label: _("Altitude"),
                            icon: 'mountain-symbolic',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]