'MapView' object has no attribute '_preview_image_display_handler'

162
0
04-04-2021 08:44 AM
Labels (1)
AviBagchi1
New Contributor

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.



0 Kudos
0 Replies