diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index d6130b503..dab8ab07a 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -136,6 +136,7 @@ class GeoGraphyView(OsmGps, NavigationView): OsmGps.__init__(self, uistate) self.dbstate = dbstate self.dbstate.connect('database-changed', self.change_db) + self.dbstate.connect('no-database', self.clear_view) self.default_text = "Enter location here!" self.centerlon = config.get("geography.center-lon") self.centerlat = config.get("geography.center-lat") @@ -261,6 +262,13 @@ class GeoGraphyView(OsmGps, NavigationView): NavigationView.on_delete(self) self._config.save() + def clear_view(self): + self.place_list = [] + self.remove_all_markers() + self.remove_all_gps() + self.remove_all_tracks() + self.message_layer.clear_messages() + def change_db(self, dbse): """ Callback associated with DbState. Whenever the database