Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer loading spinner proof-of-concept #1979

Closed
giswqs opened this issue Apr 18, 2024 · 0 comments · Fixed by #1983
Closed

Layer loading spinner proof-of-concept #1979

giswqs opened this issue Apr 18, 2024 · 0 comments · Fixed by #1983
Labels
Feature Request New feature or request

Comments

@giswqs
Copy link
Member

giswqs commented Apr 18, 2024

This is a proof-of-concept of the layer loading spinner. It works in JupyterLab, but does not work VS Code. Bug reported on the ipywdiget repo. jupyter-widgets/ipywidgets#3909

import ee
import geemap
import ipywidgets as widgets

m = geemap.Map()
image = ee.Image('USGS/SRTMGL1_003')
vis = {'min': 0, 'max': 4000, 'palette': 'terrain'}
layer = geemap.ee_tile_layer(image, vis, 'SRTM DEM')
m.add_layer(layer)

spinner = widgets.Button(description='Loading ...', icon='spinner spin lg')
m.add_widget(spinner, position='topright')

def loading_change(change):
    if change['new']:
        spinner.description = "Loading ..."
        spinner.icon = "spinner spin lg"
    else:
        spinner.description = "Loaded"
        spinner.icon = "check"        
layer.observe(loading_change, 'loading')
m

Peek 2024-04-18 13-47

@giswqs giswqs added the Feature Request New feature or request label Apr 18, 2024
@giswqs giswqs linked a pull request Apr 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant