数据是从Google Sheets中的两列中提取的,如下所示:
latitude = list(map(float, wks.col_values(3)[1:]))
longitude = list(map(float, wks.col_values(4)[1:]))下面是创建地图的代码:
gmap = gmplot.GoogleMapPlotter(33.204345, -71.67478, 14, apikey="")
gmap.heatmap(latitude, longitude)   #this works
gmap.marker(latitude, longitude, color='cornflowerblue')  
gmap.draw("test55.html") gmap.heatmap工作得非常好...但是,gmap.marker根本不会工作,并产生以下错误:
TypeError: must be real number, not list为什么gmap标记不接受我的坐标?:|
发布于 2020-07-05 01:14:32
正如注释中所提到的,您可以手动遍历marker(),但更简单的选择是只使用scatter()
gmap.scatter(latitude, longitude, color='cornflowerblue')https://stackoverflow.com/questions/62518000
复制相似问题