[gnome-maps/wip/mlundblad/photon-geocode: 3/4] WIP: placeEntry: Hook up Photon geocode



commit c733066c69d1c13fe5a6e9ab99efaae41a21ab0c
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Apr 23 23:13:39 2019 +0200

    WIP: placeEntry: Hook up Photon geocode

 src/placeEntry.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/src/placeEntry.js b/src/placeEntry.js
index 820185a..f024fd1 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -28,6 +28,7 @@ const Gtk = imports.gi.Gtk;
 
 const Application = imports.application;
 const Location = imports.location;
+const PhotonGeocode = imports.photonGeocode;
 const Place = imports.place;
 const PlaceStore = imports.placeStore;
 const PlacePopover = imports.placePopover;
@@ -206,6 +207,21 @@ var PlaceEntry = GObject.registerClass({
         let bbox = this._mapView.view.get_bounding_box();
 
         this._popover.showSpinner();
+
+        Application.photonGeocode.search(this.text,
+                                         this._mapView.view.latitude,
+                                         this._mapView.view.longitude,
+                                         (places, error) => {
+            Utils.debug('places: ' + places);
+            if (!places) {
+                this.place = null;
+                this._popover.showNoResult();
+                return;
+            }
+            this._popover.updateResult(places, this.text);
+            this._popover.showResult();
+        });
+        /*
         this._cancellable = new Gio.Cancellable();
         Application.geocodeService.search(this.text, bbox, this._cancellable, (places) => {
             if (!places) {
@@ -216,5 +232,6 @@ var PlaceEntry = GObject.registerClass({
             this._popover.updateResult(places, this.text);
             this._popover.showResult();
         });
+        */
     }
 });


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