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




commit 7127ab5eb7f1b918b39a2523a29fec71be7e1fbe
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..57e83b66 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', '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]