-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
33 lines (28 loc) · 1.06 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-2.0.3.min.js" data-semver="2.0.3" data-require="jquery"></script>
</head>
<body>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places" type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
var options = {
types: ['(regions)']
};
var input = document.getElementById('searchTextField');
var autocomplete = new google.maps.places.Autocomplete(input , options);
google.maps.event.addDomListener(autocomplete, 'place_changed', function() {
console.log('CHANGED');
console.log(autocomplete.getPlace());
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div class="row">
<input id="searchTextField" type="text" size="50" placeholder="Enter a location" autocomplete="on">
</div>
</body>
</html>