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

Error when drawing circles on Map #896

Closed
Daniel-Trung-Nguyen opened this issue Feb 1, 2022 · 2 comments
Closed

Error when drawing circles on Map #896

Daniel-Trung-Nguyen opened this issue Feb 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Daniel-Trung-Nguyen
Copy link

Hi,
I think there is some error with the drawing circles on the Map. There were no circles created (only drop pins after releasing the mouse) but no error messages were given. When I tried to clear features from the Map, I received this error:

`There was an error creating Earth Engine Feature.

ValueError Traceback (most recent call last)
G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\geemap\geemap.py in handle_draw(target, action, geo_json)
519 if action == "deleted" and len(self.draw_features) > 0:
--> 520 self.draw_features.remove(feature)
521 self.draw_count -= 1

ValueError: list.remove(x): x not in list

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\geemap\geemap.py in handle_draw(target, action, geo_json)
547 self.roi_end = False
548 print("There was an error creating Earth Engine Feature.")
--> 549 raise Exception(e)
550
551 draw_control.on_draw(handle_draw)

Exception: list.remove(x): x not in list

There was an error creating Earth Engine Feature.

AttributeError Traceback (most recent call last)
G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\geemap\geemap.py in handle_draw(target, action, geo_json)
535 else:
--> 536 self.substitute_layer(self.draw_layer, ee_draw_layer)
537 self.draw_layer = ee_draw_layer

G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\ipyleaflet\leaflet.py in substitute_layer(self, old, new)
2169 new = basemap_to_tiles(new)
-> 2170 if old.model_id not in self._layer_ids:
2171 raise LayerException('Could not substitute layer: layer not on map.')

AttributeError: 'NoneType' object has no attribute 'model_id'

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\geemap\geemap.py in handle_draw(target, action, geo_json)
547 self.roi_end = False
548 print("There was an error creating Earth Engine Feature.")
--> 549 raise Exception(e)
550
551 draw_control.on_draw(handle_draw)

Exception: 'NoneType' object has no attribute 'model_id'

There was an error creating Earth Engine Feature.

AttributeError Traceback (most recent call last)
G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\geemap\geemap.py in handle_draw(target, action, geo_json)
535 else:
--> 536 self.substitute_layer(self.draw_layer, ee_draw_layer)
537 self.draw_layer = ee_draw_layer

G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\ipyleaflet\leaflet.py in substitute_layer(self, old, new)
2169 new = basemap_to_tiles(new)
-> 2170 if old.model_id not in self._layer_ids:
2171 raise LayerException('Could not substitute layer: layer not on map.')

AttributeError: 'NoneType' object has no attribute 'model_id'

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
G:\My Drive\CFLUX\DayCentAU\Miniconda\envs\dca\lib\site-packages\geemap\geemap.py in handle_draw(target, action, geo_json)
547 self.roi_end = False
548 print("There was an error creating Earth Engine Feature.")
--> 549 raise Exception(e)
550
551 draw_control.on_draw(handle_draw)

Exception: 'NoneType' object has no attribute 'model_id'`

@Daniel-Trung-Nguyen Daniel-Trung-Nguyen added the bug Something isn't working label Feb 1, 2022
@giswqs
Copy link
Member

giswqs commented Feb 1, 2022

This an ipyleaflet bug jupyter-widgets/ipyleaflet#876. There is not much I can do about it. You can either downgrade ipyleaflet to v0.13.3 or wait until ipyleaflet to fix the bug.

@giswqs giswqs closed this as completed Feb 1, 2022
@knaaptime
Copy link

it might be useful to leave this issue open for discoverability until its fixed upstream :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants