From bd89ee18892dd877f519e06eaf4d37d836bbb39e Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Fri, 27 May 2011 22:05:10 +0000 Subject: [PATCH] Geography : add go to place in the right click menu for the places map view. svn: r17598 --- src/plugins/lib/maps/grampsmaps.py | 3 --- src/plugins/view/geoplaces.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/plugins/lib/maps/grampsmaps.py b/src/plugins/lib/maps/grampsmaps.py index 50ce86e57..fa038d653 100644 --- a/src/plugins/lib/maps/grampsmaps.py +++ b/src/plugins/lib/maps/grampsmaps.py @@ -242,7 +242,6 @@ class osmGpsMap(): found = False mark_selected = [] oldplace = "" - print "deb" for mark in self.places_found: # as we are not precise with our hand, reduce the precision # depending on the zoom. @@ -276,9 +275,7 @@ class osmGpsMap(): lonok = True if latok and lonok: mark_selected.append(mark) - print mark found = True - print "fin" return mark_selected def is_there_a_marker_here(self, lat, lon): diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py index af1488211..395918efd 100644 --- a/src/plugins/view/geoplaces.py +++ b/src/plugins/view/geoplaces.py @@ -323,6 +323,27 @@ class GeoPlaces(GeoGraphyView): add_item.connect("activate", self.show_all_places, event, lat , lon) add_item.show() menu.append(add_item) + add_item = gtk.MenuItem(_("Centering on Place")) + add_item.show() + menu.append(add_item) + itemoption = gtk.Menu() + itemoption.set_title(_("Centering on Place")) + itemoption.show() + add_item.set_submenu(itemoption) + oldplace = "" + for mark in self.sort: + if mark[0] != oldplace: + oldplace = mark[0] + modify = gtk.MenuItem(mark[0]) + modify.show() + modify.connect("activate", self.goto_place, float(mark[3]), float(mark[4])) + itemoption.append(modify) + + def goto_place(self, obj, lat, lon): + """ + Center the map on latitude, longitude. + """ + self.set_center(None, None, lat, lon) def get_default_gramplets(self): """