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




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

    WIP: place: Return place icon based on osmType and osmValue

 src/place.js | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/place.js b/src/place.js
index 0ccb7c91..018ec37d 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,10 @@ class Place extends Geocode.Place {
         return this._osmValue;
     }
 
+    get icon() {
+        return Gio.Icon.new_for_string(PlaceIcons.getIconForPlace(this));
+    }
+
     toJSON() {
         let bounding_box = null;
 


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