Repository navigation
Expand file tree
/
Copy pathexample.html
More file actions
35 lines (35 loc) · 1.45 KB
/
Copy pathexample.html
File metadata and controls
35 lines (35 loc) · 1.45 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
<!DOCTYPE html>
<html>
<head>
<title>User Address Autocomplete</title>
<meta charset="utf-8">
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
input { width: 100%; line-height: 24px; font-size: 18px; }
</style>
<link href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="autocomplete_map_geocoder.js"></script>
<script type="text/javascript">
$(window).load(function(){
map = new AutocompleteMapGeocoder("#map-canvas", "#address", "#latitude", "#longitude", -23.548881, -46.638336);
$("form").on("submit", function(event){
event.preventDefault();
alert($(this).serialize());
});
});
</script>
</head>
<body>
<form action="#">
<input type="text" name="address" id="address" placeholder="São Paulo" />
<input type="hidden" name="latitude" id="latitude" />
<input type="hidden" name="longitude" id="longitude" />
</form>
<div id="map-canvas"></div>
</body>
</html>