[gnome-maps/wip/mlundblad/handle-osm-urls: 1/5] placeStore: Add function to get by raw OSM ID



commit dc27b0a79d4ba97714d0a2d7dbfe37989581459a
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Jul 1 12:35:14 2019 +0200

    placeStore: Add function to get by raw OSM ID
    
    Adds a function to get a place from the store
    based on raw OSM type and ID.

 src/placeStore.js | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index 3757509..7d05dc2 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -309,6 +309,14 @@ class PlaceStore extends Gtk.ListStore {
             return this._typeTable[place.uniqueID] !== undefined;
     }
 
+    existsWithOsmTypeAndId(osmType, osmId) {
+        let id = osmType + '-' + osmId;
+        if (this._typeTable[id])
+            return this._typeTable[id];
+        else
+            return null;
+    }
+
     _removeIf(evalFunc, stop) {
         this.foreach((model, path, iter) => {
             if (evalFunc(model, iter)) {


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