[gnome-maps/wip/mlundblad/add-email-and-takeaway: 1/4] place: Add boolean read-only property for eating & drinking




commit e8d82c1501417ccddeb2c9180660b5afa1969803
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 821ffb10..6cbfda98 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 isEatingAndDrinking() {
+        return this._osmKey === 'amenity' &&
+               ['bar', 'biergarten', 'cafe', 'fast_food', 'food_court',
+                'restaurant', 'pub'].indexOf(this._osmValue) !== -1;
+    }
+
     toJSON() {
         let bounding_box = null;
 


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