-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmap.html
57 lines (53 loc) · 1.56 KB
/
map.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
var markersArray = [];
function initialize() {
var start = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 13,
center: start,
mapTypeId: google.maps.MapTypeId.HYBRID,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL
}
};
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
}
function create_marker(lat, lon) {
latlng = new google.maps.LatLng(lat,lon);
marker = new google.maps.Marker({
position: latlng,
title: "",
map: map
});
markersArray["" + lat + "," + lon] = marker
}
function show_marker(lat, lon) {
center = new google.maps.LatLng(lat,lon);
map.panTo(center);
map.setZoom(15);
}
function set_center(lat, lon) {
center = new google.maps.LatLng(lat,lon);
map.setCenter(center);
map.setZoom(13);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:400px; height:400px"></div>
</body>
</html>