Select to view content in your preferred language

Mapwidget not displaying in Jupyter Notebook.

4166
9
02-12-2019 10:47 AM
JamalWest2
Regular Contributor

I can no longer see the mapview widget in jupyter notebook. I get the message that hide_modeswitch is set to True. This means when I try to display a webmap it does not show up.

from arcgis.mapping import WebMap
la_parks_trails = webmapjw(webmap)
la_parks_trails

I get the line 

MapView(hide_mode_switch=True, layout=Layout(height='400px', width='100%'))

In the documentation it says that if theis hapens you must reinitialize the map. How do I do this? I have tried several ways and nothing works. I have also tried just creating a new project, but that dpesn't work either.

9 Replies
AhmedGiwa1
New Contributor

I also have the same issue:

BelindaPeng
New Contributor

I have the same issue too, can someone help?

0 Kudos
ImranKhan_P
Regular Contributor

Belinda PengAhmed GiwaJamal West

Guys,

Could you try running this in a cell

!jupyter nbextension enable --py widgetsnbextension‍‍

Post which create a new notebook and try to display Map Widget.

0 Kudos
ValCannon2
Occasional Contributor

I just get this:

0 Kudos
JenniferSwift
Occasional Contributor

Several of my students who are MAC users have this issue; we are all using the same version of Jupyter, same browser, same Anaconda, all updated everything today, and 2 out of 7 can't get maps in Jupyter. We tried the enable extension above and that does not fix the issue.

Thoughts and workarounds welcome. Next stop is to move to Google CoLab Jupyter or Esri Notebooks...?

0 Kudos
OlgaZakharo
New Contributor

Google CoLab has the same issue. 

0 Kudos
SamMontoia1
Regular Contributor

as a work around, Running the notebook in Jupyter notebooks (not Jupyter Lab) the Mapview displays properly. 

There does seem to be a mapview.jupyter_target variable that's listed on the arcgis.widgets module api reference that is read_only.  though it can be set to "lab" or other string if you force it. But that doesn't seem to help anything. Also prior to setting it as I show below, reading the data produces an empty string.  I don't understand if this variable is just not set, but it also seems like it should be set based on the IDE you're using.  Is that the disconnect here? 

This seems like the problem variable but again how to reset a read_only variable is elusive to me right now.

0 Kudos
OlgaZakharo
New Contributor

I am having similar issue in Google Colab. if I run this:

map1 = gis.map()
map1.extent = example_item.extent
map1
Nothing is displayed.
0 Kudos
Arne_Gelfert
Frequent Contributor

Did anyone ever get this resolved? Following some of the examples here and get this....

from arcgis.mapping import WebMap
web_map_obj = WebMap(item)
web_map_obj

>>> MapView(hide_mode_switch=True, layout=Layout(height='400px', width='100%'))
0 Kudos