[gnome-maps/wip/mlundblad/additional-place-icons: 5/6] place: Return place icon based on osmType and osmValue




commit 92a55bd9a61348a4f62e94cfbe716e32c64d29a8
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Apr 6 22:02:03 2021 +0200

    place: Return place icon based on osmType and osmValue

 src/place.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/place.js b/src/place.js
index 0ccb7c91..8dd499e7 100644
--- a/src/place.js
+++ b/src/place.js
@@ -22,11 +22,13 @@
 const _ = imports.gettext.gettext;
 
 const Geocode = imports.gi.GeocodeGlib;
+const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 
 const Location = imports.location;
 const Overpass = imports.overpass;
+const PlaceIcons = imports.placeIcons;
 const URLS = imports.urls;
 const Utils = imports.utils;
 
@@ -265,6 +267,14 @@ class Place extends Geocode.Place {
         return this._osmValue;
     }
 
+    get icon() {
+        return Gio.Icon.new_for_string(this._getIconName());
+    }
+
+    _getIconName() {
+        return PlaceIcons.getIconForPlace(this);
+    }
+
     toJSON() {
         let bounding_box = null;
 


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