Select to view content in your preferred language

Could not update layer using draw() or add_layer()

821
3
01-30-2023 09:14 PM
Labels (3)
YunzeWei
Emerging Contributor

Using add_layer():

Error message:

Could not update layer. Error: Script error for "esri/layers/ImageryLayer" http://requirejs.org/docs/errors.html#scripterror See the browser console for more info.

code:

usa_map = my_gis.map('USA', zoomlevel=4) # you can specify the zoom level when creating a map
world_timezones_item = my_gis.content.get('312cebfea2624e108e234220b04460b8')
usa_map.add_layer(world_timezones_item)

 

Using draw():

Error message:

Error: Script error for "esri/layers/GraphicsLayer"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:168:17)
at HTMLScriptElement.onScriptError (require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1735:36)

code:

from arcgis.geocoding import geocode

china_extent = geocode('China')[0]['extent']
china_capitols_fset = geocode('Capitol', search_extent=china_extent, max_locations=10, as_featureset=True)

capitol_symbol = {"angle":0,"xoffset":0,"yoffset":0,"type":"picture-marker",
"url":"http://static.arcgis.com/images/Symbols/PeoplePlaces/esriBusinessMarker_57.png",
"contentType":"image/png","width":24,"height":24}
my_map.draw(china_capitols_fset, symbol=capitol_symbol)

0 Kudos
3 Replies
YunzeWei
Emerging Contributor

arcgis was installed using "conda install -c esri arcgis" with py 3.9

0 Kudos
YunzeWei
Emerging Contributor

IDE: Jupyter notebook

0 Kudos
YunzeWei
Emerging Contributor

I just reloaded the IDE, and now it works... SO WEIRD...

0 Kudos