Skip to content

Commit

Permalink
OWMap: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Nov 15, 2016
1 parent 7e738ca commit a4c0e0d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Orange/widgets/visualize/owmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(self, parent=None):

def __del__(self):
os.remove(self._overlay_image_path)
self._image_token = np.nan

def set_data(self, data, lat_attr, lon_attr):
self.data = data
Expand All @@ -79,6 +80,8 @@ def showEvent(self, *args):

@pyqtSlot()
def fit_to_bounds(self, fly=True):
if self.data is None:
return
lat_data = self.data.get_column_view(self.lat_attr)[0]
lon_data = self.data.get_column_view(self.lon_attr)[0]
north, south = np.nanmax(lat_data), np.nanmin(lat_data)
Expand Down Expand Up @@ -612,6 +615,10 @@ def _set_clustering():

autocommit = settings.Setting(True)

def __del__(self):
self.progressBarFinished(None)
self.map = None

def commit(self):
self.send('Selected Data', self.selection)

Expand Down Expand Up @@ -655,6 +662,8 @@ def _find_lat_lon():
self.lat_attr = lat.name
self.lon_attr = lon.name
self.map.set_data(self.data, lat, lon)
else:
self.map.set_data(None, None, None)
self._combo_color.setCurrentIndex(0)
self._combo_shape.setCurrentIndex(0)
self._combo_size.setCurrentIndex(0)
Expand Down

0 comments on commit a4c0e0d

Please sign in to comment.