Points appear on map google python code

ⅰ亾dé卋堺 提交于 2019-12-06 15:53:21

问题


I'm using python to develop a map (Google Maps) and add some points in specific location. After searching I found it can be done using pygmaps. So I installed it using pip, then I wrote this code and I need to add points and open a webpage for the map find the points there.

import pygmaps 
import webbrowser 
mymap = pygmaps.maps(37.428, -122.145, 16)
mymap.setgrids(37.42, 37.43, 0.001, -122.15, -122.14, 0.001)
mymap.addpoint(37.427, -122.145, "#0000FF") 
mymap.addradpoint(37.429, -122.145, 95, "#FF0000")
path = [(37.429, -122.145),(37.428, -122.145),(37.427, -122.145),(37.427, -122.146),(37.427, -122.146)] mymap.addpath(path,"#00FF00") 
mymap.draw('./mymap.draw.html') 
url = url = './mymap.draw.html'
webbrowser.open_new_tab(url) 

I didn't see the points, only the map.


回答1:


Changing

mymap.draw('./mymap.draw.html') 
url = url = './mymap.draw.html'

to

mymap.draw('mymap.draw.html') 
url = 'mymap.draw.html'

worked for me.

Edit: added screenshot.



来源:https://stackoverflow.com/questions/5606229/points-appear-on-map-google-python-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!