-
Notifications
You must be signed in to change notification settings - Fork 0
/
egeo.html
45 lines (40 loc) · 1.49 KB
/
egeo.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Find out a bounding-box of interest</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAQM4ndGoq1nYAUPZHcylyPxRXZUiqoPzi4rPMxrmvS7q0_f9NvRQPZi-d7Svg4r5cQkT5Ge_Wt7PMMA"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
function report() {
var bounds = map.getBounds();
var sw = bounds.getSouthWest();
document.getElementById("sw").innerHTML = sw.toString();
var ne = bounds.getNorthEast();
document.getElementById("ne").innerHTML = ne.toString();
var ct = bounds.getCenter();
document.getElementById("ct").innerHTML = ct.toString();
}
report()
GEvent.addListener(map, "moveend", report);
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map_canvas" style="width: 800px; height: 600px"></div>
<p>
CT = <span id="ct">center</span> <br>
SW = <span id="sw">southwest</span> <br>
NE = <span id="ne">northeast</span> <br>
</p>
</body>
</html>