From 1bde9613912dce5e996acaa32a347806415d02d1 Mon Sep 17 00:00:00 2001 From: AD Date: Tue, 29 Jan 2019 15:07:31 +0100 Subject: [PATCH] fix: correct empty bounds report --- tagmaps/classes/shared_structure.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tagmaps/classes/shared_structure.py b/tagmaps/classes/shared_structure.py index 88b3b25..cfdd580 100644 --- a/tagmaps/classes/shared_structure.py +++ b/tagmaps/classes/shared_structure.py @@ -90,10 +90,10 @@ def __init__(self): (lat, lng coordinates) """ - self.lim_lat_min = 0 - self.lim_lat_max = 0 - self.lim_lng_min = 0 - self.lim_lng_max = 0 + self.lim_lat_min = None + self.lim_lat_max = None + self.lim_lng_min = None + self.lim_lng_max = None def _upd_latlng_bounds(self, lat, lng): """Update lat/lng bounds based on coordinate pair.""" @@ -111,6 +111,11 @@ def _upd_latlng_bounds(self, lat, lng): self.lim_lng_max = lng def get_bound_report(self): + if (self.lim_lat_min is None + or self.lim_lat_max is None + or self.lim_lng_min is None + or self.lim_lng_max is None): + return f'Bounds have not been initlialized' bound_report = f'Bounds are: ' \ f'Min {float(self.lim_lng_min)} {float(self.lim_lat_min)} ' \ f'Max {float(self.lim_lng_max)} {float(self.lim_lat_max)}'