[gnome-maps/wip/mlundblad/add-email-and-takeaway: 11/12] place: Add boolean read-only property for eating & drinking
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/add-email-and-takeaway: 11/12] place: Add boolean read-only property for eating & drinking
- Date: Fri, 30 Apr 2021 21:25:12 +0000 (UTC)
commit 5dca1990b94e9210515680e8d697833dfff0f493
Author: Marcus Lundblad <ml update uu se>
Date: Fri Apr 30 23:06:12 2021 +0200
place: Add boolean read-only property for eating & drinking
src/place.js | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/place.js b/src/place.js
index 7574ef03..246fa05c 100644
--- a/src/place.js
+++ b/src/place.js
@@ -297,6 +297,16 @@ class Place extends Geocode.Place {
return PlaceIcons.getIconForPlace(this);
}
+ /**
+ * This property is true for places related to eating and/or drinking,
+ * such as restaurants, cafes, pubs and similar
+ */
+ get eatingAndDrinking() {
+ return this._osmKey === 'amenity' &&
+ ['restaurant', 'fast_food', 'food_court', 'bar', 'cafe', 'pub'].
+ indexOf(this._osmValue) !== -1;
+ }
+
toJSON() {
let bounding_box = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]