[OSGeoLive] #2389: ipyleaflet notebook

OSGeoLive trac_osgeolive at osgeo.org
Mon Aug 1 20:55:34 PDT 2022


#2389: ipyleaflet notebook
-----------------------+---------------------------------
 Reporter:  darkblueb  |      Owner:  osgeolive@…
     Type:  defect     |     Status:  new
 Priority:  major      |  Milestone:  OSGeoLive15.0
Component:  OSGeoLive  |   Keywords:  jupyter, ipyleaflet
-----------------------+---------------------------------
 build 157 **ol15**
 {{{
     /usr/lib/python3/dist-packages/ipyleaflet-0.17.0.egg-info
 }}}

 {{{

 from ipyleaflet.leaflet import Map, Marker

 center = (52.204793, 360.121558)

 m = Map(center=center, zoom=15)

 marker = Marker(location=center, draggable=True)
 m.add_layer(marker);

 display(m)

 # Now that the marker is on the Map, you can drag it with your mouse,
 # it will automatically update the `marker.location` attribute in Python

 # You can also update the marker location from Python, that will update
 the
 # marker location on the Map:
 marker.location = (50, 356)
 }}}

 {{{
 ---------------------------------------------------------------------------
 ImportError                               Traceback (most recent call
 last)
 /tmp/ipykernel_2816/2413662246.py in <module>
 ----> 1 from ipyleaflet.leaflet import Map, Marker
       2
       3 center = (52.204793, 360.121558)
       4
       5 m = Map(center=center, zoom=15)

 /usr/lib/python3/dist-packages/ipyleaflet/leaflet.py in <module>
      16 )
      17
 ---> 18 from ipywidgets.widgets.trait_types import InstanceDict
      19 from ipywidgets.embed import embed_minimal_html
      20

 ImportError: cannot import name 'InstanceDict' from
 'ipywidgets.widgets.trait_types' (/usr/lib/python3/dist-
 packages/ipywidgets/widgets/trait_types.py)

 }}}
-- 
Ticket URL: <https://trac.osgeo.org/osgeolive/ticket/2389>
OSGeoLive <https://live.osgeo.org/>
self-contained bootable DVD, USB thumb drive or Virtual Machine based on Lubuntu, that allows you to try a wide variety of open source geospatial software without installing anything.


More information about the osgeolive mailing list