[gnome-maps/wip/mlundblad/additional-place-icons: 4/5] WIP: place: Return place icon based on osmType and osmValue
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/additional-place-icons: 4/5] WIP: place: Return place icon based on osmType and osmValue
- Date: Tue, 6 Apr 2021 20:25:21 +0000 (UTC)
commit 496beb5f00670fc60f2468385d0918104147100e
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 | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/place.js b/src/place.js
index 3616c682..c03f7a94 100644
--- a/src/place.js
+++ b/src/place.js
@@ -22,6 +22,7 @@
const _ = imports.gettext.gettext;
const Geocode = imports.gi.GeocodeGlib;
+const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
@@ -249,6 +250,15 @@ class Place extends Geocode.Place {
this._nativeName = nativeName;
}
+ get icon() {
+ return Gio.Icon.new_for_string(this._getIconName());
+ }
+
+ _getIconName() {
+ // TODO: select icon name based on osmKey/osmValue
+ return 'map-marker-symbolic';
+ }
+
toJSON() {
let bounding_box = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]