-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathindex.html
More file actions
77 lines (68 loc) · 2.19 KB
/
index.html
File metadata and controls
77 lines (68 loc) · 2.19 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", function() {
var div = document.getElementById("map_canvas");
// If your app runs this program on browser,
// you need to set `API_KEY_FOR_BROWSER_RELEASE` and `API_KEY_FOR_BROWSER_DEBUG`
// before `plugin.google.maps.Map.getMap()`
//
// API_KEY_FOR_BROWSER_RELEASE for `https:` protocol
// API_KEY_FOR_BROWSER_DEBUG for `http:` protocol
//
// If your app does not use browser,
// you can comment out this code.
plugin.google.maps.environment.setEnv({
'API_KEY_FOR_BROWSER_RELEASE': 'AIzaSyBZamoub9SCWL2GriEBRSgLGVVrF0QPakk',
'API_KEY_FOR_BROWSER_DEBUG': ''
})
// Create a Google Maps native view under the map_canvas div.
var map = plugin.google.maps.Map.getMap(div);
// If you click the button, do something...
var button = document.getElementById("button");
button.addEventListener("click", function() {
// Move to the position with animation
map.animateCamera({
target: {lat: 37.422359, lng: -122.084344},
zoom: 17,
tilt: 60,
bearing: 140,
duration: 5000
});
// Add a maker
var marker = map.addMarker({
position: {lat: 37.422359, lng: -122.084344},
title: "Welecome to \n" +
"Cordova GoogleMaps plugin for iOS,Android and Browser!",
snippet: "This plugin is awesome!",
animation: plugin.google.maps.Animation.BOUNCE
});
// Show the info window
marker.showInfoWindow();
});
}, false);
</script>
<style type="text/css">
html, body {
height: 100%;
}
#map_canvas { /* Must bigger size than 100x100 pixels */
width: 100%;
height: 80%;
}
button {
padding: .5em;
margin: .5em;
}
</style>
</head>
<body>
<h1>Hello, World!</h1>
<div id="map_canvas">
<button id="button">Click me!</button>
</div>
</body>
</html>