Geography : geoclose : force to show one point in case of multiple events

at the same place.


svn: r19213
This commit is contained in:
Serge Noiraud 2012-04-03 14:44:57 +00:00
parent 2bca3eb56f
commit 9f28ab87eb
2 changed files with 12 additions and 1 deletions

View File

@ -122,6 +122,12 @@ class LifeWayLayer(gobject.GObject, osmgpsmap.GpsMapLayer):
else: else:
ctx.line_to(map_points[idx_pt][0], map_points[idx_pt][1]) ctx.line_to(map_points[idx_pt][0], map_points[idx_pt][1])
ctx.stroke() ctx.stroke()
if len(map_points) == 1 : # We have only one point
crdx = map_points[0][0]
crdy = map_points[0][1]
ctx.move_to(crdx, crdy)
ctx.line_to(crdx + 1, crdy + 1)
ctx.stroke()
for comment in self.lifeways_comment: for comment in self.lifeways_comment:
ctx = drawable.cairo_create() ctx = drawable.cairo_create()

View File

@ -259,7 +259,12 @@ class GeoClose(GeoGraphyView):
for mark in marks: for mark in marks:
startlat = float(mark[3]) startlat = float(mark[3])
startlon = float(mark[4]) startlon = float(mark[4])
points.append((startlat, startlon)) not_stored = True
for idx in range(0, len(points)):
if points[idx][0] == startlat and points[idx][1] == startlon:
not_stored = False
if not_stored:
points.append((startlat, startlon))
self.lifeway_layer.add_way(points, color) self.lifeway_layer.add_way(points, color)
if mark: if mark:
self.lifeway_layer.add_text(points, mark[1]) self.lifeway_layer.add_text(points, mark[1])