-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add layer loading spinner and remove layer button #1983
Conversation
🚀 Deployed on https://6669cc1c9992cc56d524e133--opengeos.netlify.app |
Just realized that I forgot to add a confirmation dialog when removing a layer. Will add that later |
I have added the confirmation dialog when removing a layer. The PR is ready for review now. spinner.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for taking this on!
geemap/map_widgets.py
Outdated
@@ -6,6 +6,7 @@ | |||
from IPython.core.display import HTML, display | |||
|
|||
import ee | |||
import ipyleaflet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't import ipyleaflet
in map_widgets
. This file is supposed to be agnostic to map implementation. Two possible solutions are listed below.
-
The preferred option is to avoid this problem entirely by showing the confirmation dialog above (or inside) the existing widget. It could look like another row that's added below the row scheduled for deletion or a dialog that appears over everything.
-
Build this new "confirmation" widget as any of the other core widgets and have the widget control code live in core. The new widget needs some sort of "on_confirm_deletion" event that the code code must set. Example:
Line 683 in b115dfb
def _add_basemap_selector(self, position: str, **kwargs) -> None:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have implemented the preferred option 1:
another row that's added below the row scheduled for deletion
remove.layer.mp4
The remove layer confirmatition widget is now being displayed beneath the layer row in the layer manager. See the new demo: remove.layer.mp4 |
@naschmitz @jdbcode It is ready for review now. |
This PR adds a layer loading spinner and remove layer button to the layer manager. The layer widget padding is slightly reduced from
8px
to4x
to make room for the two newly added buttons.layer_loading_spinner.mp4