[gnome-maps] Add altitude to map bubbles
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Add altitude to map bubbles
- Date: Sun, 14 Feb 2016 20:09:18 +0000 (UTC)
commit 24446e5c73f1e2bb005b7354fd94a4e7530f8a7b
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Sun Feb 14 21:08:57 2016 +0100
Add altitude to map bubbles
src/osmEditDialog.js | 6 ++++++
src/overpass.js | 2 ++
src/placeBubble.js | 6 ++++++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/osmEditDialog.js b/src/osmEditDialog.js
index be908b6..86cc10f 100644
--- a/src/osmEditDialog.js
+++ b/src/osmEditDialog.js
@@ -141,6 +141,12 @@ const OSM_FIELDS = [
type: EditFieldType.INTEGER
},
{
+ name: _("Altitude"),
+ tag: 'ele',
+ type: EditFieldType.INTEGER,
+ hint: _("Elevation (height above sea level) of a point in metres.")
+ },
+ {
name: _("Wheelchair access"),
tag: 'wheelchair',
type: EditFieldType.COMBO,
diff --git a/src/overpass.js b/src/overpass.js
index eb593fb..b276ccf 100644
--- a/src/overpass.js
+++ b/src/overpass.js
@@ -106,6 +106,8 @@ const Overpass = new Lang.Class({
place.openingHours = element.tags.opening_hours;
if (element.tags.internet_access)
place.internetAccess = element.tags.internet_access;
+ if (element.tags.ele && place.location)
+ place.location.altitude = parseFloat(element.tags.ele);
},
_getQueryUrl: function(place) {
diff --git a/src/placeBubble.js b/src/placeBubble.js
index d332ad3..618938e 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -128,6 +128,12 @@ const PlaceBubble = new Lang.Class({
info: place.population });
}
+ if (place.location.altitude > 0) {
+ let alt = place.location.altitude;
+ expandedContent.push({ label: _("Altitude:"),
+ info: Utils.prettyDistance(alt, true) });
+ }
+
if (place.openingHours) {
expandedContent.push({ label: _("Opening hours:"),
info: place.openingHoursTranslated });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]