[gnome-maps/wip/mlundblad/reduce-dup-place-init: 3/4] WIP: overpass: Use place update method
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/reduce-dup-place-init: 3/4] WIP: overpass: Use place update method
- Date: Sun, 26 Sep 2021 20:44:54 +0000 (UTC)
commit 6b36359585cdc25f367c25850c484454e4318d5d
Author: Marcus Lundblad <ml update uu se>
Date: Sat Sep 25 21:21:38 2021 +0200
WIP: overpass: Use place update method
Use method to update the place instance
from OSM tags.
src/overpass.js | 34 ++--------------------------------
1 file changed, 2 insertions(+), 32 deletions(-)
---
diff --git a/src/overpass.js b/src/overpass.js
index 158c6878..2265f24c 100644
--- a/src/overpass.js
+++ b/src/overpass.js
@@ -209,38 +209,8 @@ var Overpass = GObject.registerClass({
if (element.tags.name)
place.nativeName = element.tags.name;
- if (element.tags.population)
- place.population = element.tags.population;
- if (element.tags['contact:website'])
- place.website = element.tags['contact:website'];
- if (element.tags.website)
- place.website = element.tags.website;
- if (element.tags['contact:email'])
- place.email = element.tags['contact:email'];
- if (element.tags.email)
- place.email = element.tags.email;
- if (element.tags['contact:phone'])
- place.phone = element.tags['contact:phone'];
- if (element.tags.phone)
- place.phone = element.tags.phone;
- if (element.tags.wikipedia)
- place.wiki = element.tags.wikipedia;
- if (element.tags.wheelchair)
- place.wheelchair = element.tags.wheelchair;
- if (element.tags.opening_hours)
- 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);
- if (element.tags.religion)
- place.religion = element.tags.religion
- if (element.tags.toilets)
- place.toilets = element.tags.toilets;
- if (element.tags.takeaway)
- place.takeaway = element.tags.takeaway;
- if (element.tags.note)
- place.note = element.tags.note;
+
+ place.updateFromTags(element.tags);
}
_getLocalizedName(tags, place) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]