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.
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