-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex2.html
96 lines (74 loc) · 4.02 KB
/
index2.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<title>CS247 GeoParty!!</title>
<bgsound id="jpsound">
<link rel="Stylesheet" type="text/css" href="style.css"></link>
<script type="text/javascript" src="https://www.google.com/jsapi?key=AIzaSyBaPOMfVAm_WwTJxaBYuJBgsr4caKOjiSs"> </script>
<script type="text/javascript" src="firstpersoncam.js"></script>
<script type="text/javascript" src="math3d.js"></script>
<script type="text/javascript">
var ge;
google.load("earth", "1");
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
function createIcon(href, x, y, width, height, visible) {
var icon = ge.createIcon('');
icon.setHref(href);
// Oscar peterson
var overlay = ge.createScreenOverlay('');
overlay.setDrawOrder(1 || 0);
overlay.setVisibility(visible || false);
overlay.setIcon(icon);
overlay.getOverlayXY().set(x, ge.UNITS_PIXELS, y, ge.UNITS_INSET_PIXELS);
overlay.getScreenXY().set(0, ge.UNITS_FRACTION, 1, ge.UNITS_FRACTION);
overlay.getSize().set(width, ge.UNITS_PIXELS, height, ge.UNITS_PIXELS);
ge.getFeatures().appendChild(overlay);
return overlay;
}
var downActive, downInactive, upActive, upInactive, rightActive, rightInactive, leftActive, leftInactive;
var active, inactive;
var jetpack;
function initCB(instance) {
/* Basic initialization as per the Google Earth API documentation */
ge = instance; // Specific instance of the Google Earth (you can have more than one)
ge.getWindow().setVisibility(true);
// Directions layer
var link = ge.createLink(''); // class ge inherited from index2.html
var href = 'http://www.stanford.edu/~hyunggu/etc/cs247_arrow.kml';
//var href = "http://cs247.eidus.org/tweets.kml";
link.setHref(href);
arrowLink = ge.createNetworkLink('');
arrowLink.set(link, true, true); // Sets the link, refreshVisibility, and flyToView.
ge.getFeatures().appendChild(arrowLink);
ge.getOptions().setFlyToSpeed(50);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
/* Magic from the firstpersoncam.js */
cam = new FirstPersonCam();
cam.updateCamera();
/* Setup Navigation Feedback */
downInactive = createIcon('http://stanford.edu/~tatianai/downnavi.png', 129, 804, 70, 70, true);
downActive = createIcon('http://stanford.edu/~tatianai/downnavi2.png', 129, 804, 70, 70, false);
upInactive = createIcon('http://stanford.edu/~tatianai/upnavi.png', 130, 685, 70, 70, true);
upActive = createIcon('http://stanford.edu/~tatianai/upnavi2.png', 130, 685, 70, 70, false);
rightInactive = createIcon('http://stanford.edu/~tatianai/rightnavi1.png', 187, 745, 70, 70, true);
rightActive = createIcon('http://stanford.edu/~tatianai/leftnavi2.png', 187, 745, 70, 70, false);
leftInactive = createIcon('http://stanford.edu/~tatianai/leftnavi.png', 70, 745, 70, 70, true);
leftActive = createIcon('http://stanford.edu/~tatianai/rightnavi2.png', 70, 745, 70, 70, false);
active = createIcon('http://stanford.edu/~tatianai/geoparty_dark.png', 105, 720, 120, 120, true);
inactive = createIcon('http://stanford.edu/~tatianai/geoparty_light.png', 105, 720, 120, 120, false);
jetpack = createIcon('http://stanford.edu/~tatianai/jetpack.png', 1405, 720, 120, 120, false);
}
function failureCB(errorCode) { // TODO: compare to index.html's "instance"?
alert("Shit!");
}
google.setOnLoadCallback(init); // Calls specified once all HTML, requested APIs are loaded
</script>
<script src="https://www.google.com/uds/?file=earth&v=1" type="text/javascript"></script>
<script src="https://www.google.com/uds/api/earth/1.0/109c7b2bae7fe6cc34ea875176165d81/default.I.js" type="text/javascript"></script>
</head>
<body onKeyDown="return keyDown(event);" onKeyUp="return keyUp(event);"> <!-- Triggers javascript in firstpersoncam.js controls -->
<div id="map3d" style="height: 918px; width: 1670px;"></div>
</body>
</html>