From 4130b0cf1b7abe8a8732af297525d1baceab5ed9 Mon Sep 17 00:00:00 2001 From: Jorge Bolois Guerrero Date: Mon, 17 Oct 2022 01:36:55 +0200 Subject: [PATCH] Adding altitude. Adding more locations. --- locations/Ochagavía.json | 20 ++++++++++++++++++++ locations/Sangüesa.json | 32 ++++++++++++++++++++++++++++++++ src/ItemHTML.js | 10 +++++++--- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 locations/Ochagavía.json create mode 100644 locations/Sangüesa.json diff --git a/locations/Ochagavía.json b/locations/Ochagavía.json new file mode 100644 index 0000000..cefe4b6 --- /dev/null +++ b/locations/Ochagavía.json @@ -0,0 +1,20 @@ +{ + "name": "Ochagavía", + "altitude": 764, + "bus": true, + "train": false, + "pharmacy": true, + "smoke": true, + "supermarkets": [ + { + "type": "COVIRAN", + "url": "https://goo.gl/maps/fqWMJyHj9SrNZkBEA" + }, + { + "type": "COALIMENT", + "url": "https://goo.gl/maps/gQ78eAAS43dqWMUW9" + } + ], + "pool": true, + "gym": false +} \ No newline at end of file diff --git a/locations/Sangüesa.json b/locations/Sangüesa.json new file mode 100644 index 0000000..cb42d75 --- /dev/null +++ b/locations/Sangüesa.json @@ -0,0 +1,32 @@ +{ + "name": "Sangüesa", + "altitude": 404, + "bus": true, + "train": false, + "pharmacy": true, + "smoke": true, + "supermarkets": [ + { + "type": "BM", + "url": "https://goo.gl/maps/GvwtpFsT3TD25w7g7" + }, + { + "type": "COVIRAN", + "url": "https://goo.gl/maps/AbVahZ5DtMjkYrS26" + }, + { + "type": "EROSKI", + "url": "https://goo.gl/maps/Z5WdBxcDrjUKKAWf7" + }, + { + "type": "DIA", + "url": "https://goo.gl/maps/KNeX8T9YPwtnphyn6" + }, + { + "type": "UNIDE", + "url": "https://goo.gl/maps/oRHcLmLDNHkv6hV17" + } + ], + "pool": true, + "gym": true +} \ No newline at end of file diff --git a/src/ItemHTML.js b/src/ItemHTML.js index 57763dc..f8769f2 100644 --- a/src/ItemHTML.js +++ b/src/ItemHTML.js @@ -180,9 +180,13 @@ export default class ItemHTML { } static _createLocationName(item) { - let html = `
` - html += this._createNeutral(item.locationName); - if (item.location?.altitude) this._createIndividual('Altitud (m):', item.location.altitude); + let html = `
` + if (item.location?.name) { + html += this._createNeutral(item.location.name); + } else { + html += this._createNeutral(item.locationName); + } + if (item.location?.altitude) html += this._createIndividual('Altitud (m):', item.location.altitude); html += `
` return html;