Luca
Luca

Reputation: 1350

best way to visualize google map in python

I am wondering which is the best way to visualize google's map using python and pygtk, for now I have tried this:

import gtk
import webkit
win = gtk.Window()
win.set_default_size(600, 400)
web = webkit.WebView()
web.open('https://google-developers.appspot.com/maps/documentation/javascript/examples/map-simple')
map=gtk.Frame('Maps')
map.add(web)
win.add(map)
win.show_all()
gtk.main()

but there are some problem, for example you can not resize the window properly, and many exceptions are trown when you try to use the street view. There exist a correct way to do such thing?

Upvotes: 2

Views: 1973

Answers (1)

Luca
Luca

Reputation: 1350

I have found a solution:

import gtk
import webkit
win = gtk.Window()
win.set_default_size(600, 400)
web = webkit.WebView()
web.open('https://google-developers.appspot.com/maps/documentation/javascript/examples/map-simple')
map=gtk.Frame('Maps')
scroll = gtk.ScrolledWindow()
scroll.add(web)
map.add(scroll)
win.add(map)
win.show_all()
gtk.main()

You have just to ad a scrolled view

Upvotes: 2

Related Questions