[gnome-maps] MapView: Adapt to new geocode-glib's geocoding API



commit 9a18be6efc5bcd9bfad54362a8cb5a7ef874545d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue May 7 02:47:58 2013 +0300

    MapView: Adapt to new geocode-glib's geocoding API
    
    The geocoding API now returns Place objects with possibly a lot more
    details, rather than simple Location objects.
    
    For now we just take the Location out of the Place object and use it
    like we have been doing so far but later we'll want to actually utilize
    the information provided by Place.

 src/mapView.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index 01028d6..22858df 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -91,11 +91,15 @@ const MapView = new Lang.Class({
         forward.search_async (null, Lang.bind(this,
             function(forward, res) {
                 try {
-                    let locations = forward.search_finish(res);
-                    log (locations.length + " locations found");
+                    let places = forward.search_finish(res);
+                    log (places.length + " places found");
                     let mapLocations = new Array();
-                    locations.forEach(Lang.bind(this,
-                        function(location) {
+                    places.forEach(Lang.bind(this,
+                        function(place) {
+                            let location = place.get_location();
+                            if (location == null)
+                                return;
+
                             let mapLocation = new MapLocation.MapLocation(location, this);
                             mapLocations.push(mapLocation);
                         }));


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