在下面的代码中,我无法接受用户输入来添加Lat和经度的标记。如果有人在这个问题上帮助我,那将是很有帮助的。
import pygmaps
mymap5 = pygmaps.maps(Lat, Long, Zoom)
a = float(input("Enter the lat of Person - 1 :"))
b = float(input("Enter the longitude Person - 1 :"))
mymap5.addpoint(a[0], b[0], "#ff0000", "Title")
mymap5.draw('pygmap.html')发布于 2020-03-13 15:16:11
您正在尝试索引浮点数,这是不支持的。尝试将以下内容放入您的解释器中:
a = float(input("Enter the lat of Person - 1 :"))
b = float(input("Enter the longitude Person - 1 :"))
print(a, b)简而言之,看起来您只需要使用a和b,而不是a[0]和b[0]。
https://stackoverflow.com/questions/60672897
复制相似问题