我正在尝试使用colab和googlemaps显示覆盖在google地图上的热图图像。我进行了一些研究,发现此链接有2个可能的解决方案,但两个解决方案均无法正常工作。
在Google Colab平台的Jupyter Notebook中显示/渲染HTML文件
也许最近有什么变化?这是我的代码:
pip install gmplot
import gmplot
gmap1 = gmplot.GoogleMapPlotter(30.3164945,
78.03219179999999, 13, apikey='AIzaSyBCyhpxDYIxIq9uINYxDK5aIjWSokUvsvY' )
gmap1.draw( "map11.html" )
import os
print(os.getcwd())
!ls
/content
map11.html sample_data
import IPython
IPython.display.HTML(filename='/content/map11.html')
nothing is displayed.
from IPython.display import IFrame
IFrame(src='/content/map11.html', width=900, height=600)
localhost refused to connect.
您的本地浏览器无法从远程VM文件系统读取文件。而不是通过文件名传递HTML,请尝试直接显示HTML内容:
IPython.display.HTML(open('/content/map11.html').read())
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句