I am trying to extract the html code out of an ArcGIS Online map from Python.
from arcgis.gis import GIS
import pandas as pd
g = GIS("https://www.arcgis.com",
"name", "password")
p = {
'type':"CSV",
'title': '2020#12',
'snippet':'hwa',
'description':'test ' + \
'dataframe object to a GIS item',
'tags': 'python',
}
i=g.content.add (item_properties=p,
data="C:/Users/Name/PycharmProjects/colors/Map/New.csv"
)
q=i.publish ()
print (q)
search =
g.content.search(query="owner:name",
item_type="Feature Layer")
print(search)
map=g.map (location="United States")
item=search [0]
print (item)
map.add_layer(item)
props={'title': '2020#156',
'snippet':'hwa',
'tags': 'python',
"renderer":"autocast",
"field_name": "Threat"}
map.save (props)
map.embed ()
I get an error for called embed ().
AttributeError: 'MapView' object has no attribute
'_preview_image_display_handler'
I have tried the export_to_html () method. It throws no error but the html code is invalid when I try and embed it in google sites.
I'm also running into this issue, it does run in jupyter notebook but not in an IDE