[gnome-maps/wip/mlundblad/photon-geocode: 8/13] placeEntry: Use geocoder factory
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/photon-geocode: 8/13] placeEntry: Use geocoder factory
- Date: Sun, 9 Jun 2019 20:03:10 +0000 (UTC)
commit e5b871106e841b160cfca61a2316368be95a4fbf
Author: Marcus Lundblad <ml update uu se>
Date: Tue Apr 23 23:13:39 2019 +0200
placeEntry: Use geocoder factory
Replace usage of Nominatim through
geocode-glib with the pluggable
geocoder factory.
src/placeEntry.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/placeEntry.js b/src/placeEntry.js
index 820185a..4872f46 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -27,6 +27,7 @@ const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Application = imports.application;
+const GeocodeFactory = imports.geocode;
const Location = imports.location;
const Place = imports.place;
const PlaceStore = imports.placeStore;
@@ -206,8 +207,14 @@ var PlaceEntry = GObject.registerClass({
let bbox = this._mapView.view.get_bounding_box();
this._popover.showSpinner();
+
this._cancellable = new Gio.Cancellable();
- Application.geocodeService.search(this.text, bbox, this._cancellable, (places) => {
+ GeocodeFactory.getGeocoder().search(this.text,
+ this._mapView.view.latitude,
+ this._mapView.view.longitude,
+ this._cancellable,
+ (places, error) => {
+
if (!places) {
this.place = null;
this._popover.showNoResult();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]