From 9f28ab87ebc5950990c5d1f4064f6fe588f15588 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Tue, 3 Apr 2012 14:44:57 +0000 Subject: [PATCH] Geography : geoclose : force to show one point in case of multiple events at the same place. svn: r19213 --- src/plugins/lib/maps/lifewaylayer.py | 6 ++++++ src/plugins/view/geoclose.py | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/lib/maps/lifewaylayer.py b/src/plugins/lib/maps/lifewaylayer.py index 91a09725d..66623668b 100644 --- a/src/plugins/lib/maps/lifewaylayer.py +++ b/src/plugins/lib/maps/lifewaylayer.py @@ -122,6 +122,12 @@ class LifeWayLayer(gobject.GObject, osmgpsmap.GpsMapLayer): else: ctx.line_to(map_points[idx_pt][0], map_points[idx_pt][1]) 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: ctx = drawable.cairo_create() diff --git a/src/plugins/view/geoclose.py b/src/plugins/view/geoclose.py index a91699b09..7d95211fc 100644 --- a/src/plugins/view/geoclose.py +++ b/src/plugins/view/geoclose.py @@ -259,7 +259,12 @@ class GeoClose(GeoGraphyView): for mark in marks: startlat = float(mark[3]) 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) if mark: self.lifeway_layer.add_text(points, mark[1])