[gnome-maps] mapview: Add preferred bounding box for search



commit 43bf73cc0e2e8e68bf121ba423e3daf43a1a0d15
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Sat Dec 28 14:44:47 2013 +0100

    mapview: Add preferred bounding box for search
    
    Geocode allows us to specify a preferred bounding box for
    searching. This patch uses the view bounding box from Champlain
    View to provide the current view as preferred for search.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719586

 src/mapView.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index 7e388b1..d4e7da3 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -109,7 +109,15 @@ const MapView = new Lang.Class({
         let forward = Geocode.Forward.new_for_string(searchString);
         let places = [];
         let answerCount = Application.settings.get('max-search-results');
+        let bbox = this.view.get_bounding_box();
 
+        forward.search_area = new Geocode.BoundingBox({
+            top: bbox.top,
+            left: bbox.left,
+            bottom: bbox.bottom,
+            right: bbox.right
+        });
+        forward.bounded = false;
         forward.set_answer_count(answerCount);
         forward.search_async (null, (function(forward, res) {
             try {


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