-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample23.py
42 lines (40 loc) · 1.19 KB
/
example23.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os, urllib, StringIO
htmlfile = " <!DOCTYPE html> \
<html> \
<head> \
<title>Google Maps JavaScript API v3 Example: Map Simple</title> \
<meta name=\"viewport\" \
content=\"width=device-width, initial-scale=1.0, user-scalable=no\"> \
<meta charset=\"UTF-8\"> \
<style type=\"text/css\"> \
html, body, #map_canvas { \
margin: 0; \
padding: 0; \
height: 100%; \
} \
</style> \
<script type=\"text/javascript\" \
src=\"http://maps.googleapis.com/maps/api/js?sensor=false\"></script> \
<script type=\"text/javascript\"> \
var map; \
function initialize() { \
var myOptions = { \
zoom: 8, \
center: new google.maps.LatLng(-34.397, 150.644), \
mapTypeId: google.maps.MapTypeId.ROADMAP \
}; \
map = new google.maps.Map(document.getElementById('map_canvas'), \
myOptions); \
} \
\
google.maps.event.addDomListener(window, 'load', initialize); \
</script> \
</head> \
<body> \
<div id=\"map_canvas\"></div> \
</body> \
</html> "
#print htmlfile
output = StringIO.StringIO()
output.write(htmlfile)
os.startfile(output.getvalue())