Geography : add go to place in the right click menu for the places map view.

svn: r17598
This commit is contained in:
Serge Noiraud 2011-05-27 22:05:10 +00:00
parent a9bd22a288
commit bd89ee1889
2 changed files with 21 additions and 3 deletions

View File

@ -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):

View File

@ -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):
"""