Skip to content

Commit

Permalink
Merge pull request #83 from ojustino/avail-modes
Browse files Browse the repository at this point in the history
Available modes property
  • Loading branch information
astrofrog committed Apr 12, 2018
2 parents 9dcd279 + 1c41f71 commit 11de8d1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pywwt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def __init__(self, **kwargs):
self.observe(self._on_trait_change, type='change')
self._available_layers = get_imagery_layers(DEFAULT_SURVEYS_URL)
self.imagery = ImageryLayers(self._available_layers)
self._available_modes = ['sky', 'planet', 'solar_system',
'milky_way', 'universe', 'panorama']
self.current_mode = 'sky'
# self.current_mode can be 'sky', 'planet', 'solar_system',
# 'milky_way', 'universe', or 'panorama'


# NOTE: we deliberately don't force _on_trait_change to be called here
# for the WWT settings, as the default values are hard-coded in wwt.html
# This is done because there is otherwise no reliable way of making sure
Expand Down Expand Up @@ -347,6 +347,13 @@ def reset_view(self):
if self.current_mode == 'panorama':
pass

@property
def available_modes(self):
"""
A list of the modes that are currently available in the viewer.
"""
return sorted(self._available_modes)

def load_image_collection(self, url):
"""
Load a collection of layers for possible use in the viewer.
Expand All @@ -362,7 +369,7 @@ def load_image_collection(self, url):
@property
def available_layers(self):
"""
A list of currently available layers for the viewer
A list of the layers that are currently available in the viewer.
"""
return sorted(self._available_layers)

Expand Down

0 comments on commit 11de8d1

Please sign in to comment.