[gnome-maps/wip/mlundblad/photon-geocode: 10/14] contextMenu: Use geocoder factory for "What's here"



commit c3880e5cbb812a6b2eedaf2409cc8ab64b3f22c5
Author: Marcus Lundblad <ml update uu se>
Date:   Wed May 1 23:21:01 2019 +0200

    contextMenu: Use geocoder factory for "What's here"
    
    Use the geocoder factory for performing reverse geocoding.

 src/contextMenu.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/contextMenu.js b/src/contextMenu.js
index 4e802a7..19b5b45 100644
--- a/src/contextMenu.js
+++ b/src/contextMenu.js
@@ -28,6 +28,7 @@ const Mainloop = imports.mainloop;
 
 const Application = imports.application;
 const ExportViewDialog = imports.exportViewDialog;
+const GeocodeFactory = imports.geocode;
 const Location = imports.location;
 const OSMAccountDialog = imports.osmAccountDialog;
 const OSMEdit = imports.osmEdit;
@@ -120,11 +121,8 @@ var ContextMenu = GObject.registerClass({
     }
 
     _onWhatsHereActivated() {
-        let location = new Location.Location({ latitude: this._latitude,
-                                               longitude: this._longitude,
-                                               accuracy: 0 });
-
-        Application.geocodeService.reverse(location, null, (place) => {
+        GeocodeFactory.getGeocoder().reverse(this._latitude, this._longitude,
+                                      (place) => {
             if (place) {
                 this._mapView.showPlace(place, false);
             } else {


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