首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >gmplot Marker在标记256点后不起作用

gmplot Marker在标记256点后不起作用
EN

Stack Overflow用户
提问于 2019-11-09 02:55:46
回答 1查看 129关注 0票数 0

我试图用gmplot在地图上标记一堆点,观察到在某个点之后,它会停止标记,并清除所有以前标记的点。我调试了gmplot.py模块,发现当点数组的长度超过256时,这种情况就会发生,而不会给出任何错误和警告。

代码语言:javascript
运行
复制
self.points = [] on gmplot.py

由于我对Python和OOPs概念非常陌生,有没有方法可以覆盖它并标记超过256个点?

EN

回答 1

Stack Overflow用户

发布于 2020-01-01 08:36:55

您使用的是gmplot.GoogleMapPlotter.Scatter还是gmplot.GoogleMapPlotter.Marker。我使用了其中任何一个,并且能够为我正在工作的项目获得465积分。有没有可能是你的API密钥问题?

我的代码的部分片段

代码语言:javascript
运行
复制
import gmplot
import pandas as pd
# df is the database with Lat, Lon and formataddress columns
# change to list, not sure you need to do this.  I think you can cycle through
# directly using iterrows.  I have not tried that though
latcollection=df['Lat'].tolist()
loncollection=df['Lon'].tolist()
addcollection=df['formataddress'].tolist()
# center map with the first co-ordinates
gmaps2 = gmplot.GoogleMapPlotter(latcollection[0],loncollection[0],13,apikey='yourKey')
for i in range(len(latcollection)):
    gmaps2.marker(latcollection[i],loncollection[i],color='#FF0000',c=None,title=str(i)+' '+ addcollection[i])
gmaps2.draw(newdir + r'\laplot_marker_full.html')                  

我可以将鼠标悬停在第465点上,因为我大致知道它在哪里,而且我能够使用str(464) <formataddress(464)>获得标题,因为我的数组是从0开始索引的

如果您使用的是windows,请务必查看GitHub站点以修改gmplot文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58772329

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档