[gnome-maps/wip/mlundblad/handle-osm-urls: 5/11] place: Add a property to mark as pre-filled



commit a5209d4f9daf6f895594cd103065be8620e4a425
Author: Marcus Lundblad <ml update uu se>
Date:   Thu Jun 27 21:33:20 2019 +0200

    place: Add a property to mark as pre-filled
    
    Property to set when adding Overpass data directly
    when creating a place (such as when loading an OSM
    object from a URL).

 src/place.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/place.js b/src/place.js
index babb8b6..7d72af2 100644
--- a/src/place.js
+++ b/src/place.js
@@ -75,6 +75,13 @@ class Place extends Geocode.Place {
         this._initialZoom = params.initialZoom;
         delete params.initialZoom;
 
+        /* set to true if the instance is pre-filled with Overpass data,
+         * at the time of creation, as will be the case when loading a place
+         * from an OSM object URL
+         */
+        this._prefilled = params.prefilled;
+        delete params.prefilled;
+
         /* Determines if the place should be added to the place store */
         if (typeof(params.store) === 'undefined') {
             this._store = true;
@@ -233,6 +240,14 @@ class Place extends Geocode.Place {
         return this._initialZoom;
     }
 
+    get prefilled() {
+        return this._prefilled;
+    }
+
+    set prefilled(prefilled) {
+        this._prefilled = prefilled;
+    }
+
     _translateWheelchair(string) {
         switch(string) {
             /* Translators:


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