Trying to use the ArcGIS API for Python in Juypter Notebooks. It seems the map variable is required to be at the bottom of the cell. For example, this doesn't work for me
if I remove the if statement and put map2 at the bottom (as in most examples) it works.
is there anyway around that?
Hi, Brad Cooper
This is default behavior in Jupyter, if there is an object at the end of a cell it is evaluated and sent to the output area, put it anywhere else and it's ignored.
There are several ways around this.
In your case the easiest solution is probably a simple restructure of the code:
Or you can wrap your code in a function:
Thanks, I ended up doing a little different and forgot to post. Our solution was to use display
display(_map)
example: