1.1 --- a/EventAggregatorSupport.py Tue Apr 12 00:01:28 2011 +0200
1.2 +++ b/EventAggregatorSupport.py Wed Apr 13 00:31:45 2011 +0200
1.3 @@ -16,6 +16,7 @@
1.4 import time
1.5 import re
1.6 import bisect
1.7 +import operator
1.8
1.9 try:
1.10 set
1.11 @@ -1818,6 +1819,30 @@
1.12 else:
1.13 return self.__add__(Reference(-other.degrees, other.minutes, other.seconds))
1.14
1.15 + def _compare(self, op, other):
1.16 + if not isinstance(other, Reference):
1.17 + return NotImplemented
1.18 + else:
1.19 + return op(self.to_degrees(), other.to_degrees())
1.20 +
1.21 + def __eq__(self, other):
1.22 + return self._compare(operator.eq, other)
1.23 +
1.24 + def __ne__(self, other):
1.25 + return self._compare(operator.ne, other)
1.26 +
1.27 + def __lt__(self, other):
1.28 + return self._compare(operator.lt, other)
1.29 +
1.30 + def __le__(self, other):
1.31 + return self._compare(operator.le, other)
1.32 +
1.33 + def __gt__(self, other):
1.34 + return self._compare(operator.gt, other)
1.35 +
1.36 + def __ge__(self, other):
1.37 + return self._compare(operator.ge, other)
1.38 +
1.39 def to_degrees(self):
1.40 return sign(self.degrees) * (abs(self.degrees) + self.minutes / 60.0 + self.seconds / 3600.0)
1.41
2.1 --- a/macros/EventAggregator.py Tue Apr 12 00:01:28 2011 +0200
2.2 +++ b/macros/EventAggregator.py Wed Apr 13 00:31:45 2011 +0200
2.3 @@ -1420,9 +1420,13 @@
2.4 except (KeyError, ValueError):
2.5 pass
2.6
2.7 - # Skip unpositioned locations or events.
2.8 + # Skip unpositioned locations and locations outside the map.
2.9
2.10 - if latitude is None or longitude is None:
2.11 + if latitude is None or longitude is None or \
2.12 + latitude < map_bottom_left_latitude or \
2.13 + longitude < map_bottom_left_longitude or \
2.14 + latitude > map_top_right_latitude or \
2.15 + longitude > map_top_right_longitude:
2.16 continue
2.17
2.18 # Get the position and dimensions of the map marker.