-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.ralph.htm
172 lines (134 loc) · 5.33 KB
/
map.ralph.htm
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<head>
<!--
Modified from the Google Earth API Examples for Sciencenter
Stephen Longfield, 2013
Ralph Yozzo, 2013-2014
-->
<title>Fracking Map sciencenter.org</title>
<!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
<script src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
<script type="text/javascript" src="http://earth-api-utility-library.googlecode.com/svn/trunk/extensions/dist/extensions.pack.js"></script>
<script type="text/javascript" src="bboxview.js"></script>
<script>
google.load("earth", "1.x");
var ge = null;
var gex = null;
var appPath = document.location.href.replace(/\/[^\/]*$/, '/');
function init() {
google.earth.createInstance("map3d", initCallback, failureCallback);
}
function initCallback(pluginInstance) {
// Generate data structures
ge = pluginInstance;
gex = new GEarthExtensions(ge);
// Set up the maps
ge.getWindow().setVisibility(true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW)
google.earth.addEventListener(ge.getView(), "viewchange", eventListener);
posnum=0;update(0)
//addoverlay()
}
function eventListener(event) {
var camera = ge.getView().copyAsCamera(ge.ALTITUDE_RELATIVE_TO_GROUND);
document.getElementById("id_alt_cam").innerHTML = 3.28084* camera.getAltitude().toFixed(2);
addoverlay();
}
function addoverlay(centerparm){
var groundOverlay = ge.createGroundOverlay('');
groundOverlay.setIcon(ge.createIcon(''))
//groundOverlay.getIcon().setHref("http://www.google.com/intl/en_ALL/images/logo.gif");
groundOverlay.getIcon().setHref("https://sciencenterfracking.appspot.com/static/drillpaths.gif");
groundOverlay.setLatLonBox(ge.createLatLonBox(''));
var center = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
var north = center.getLatitude() + .005;
var south = center.getLatitude() - .005;
var east = center.getLongitude() + .005;
var west = center.getLongitude() - .005;
var rotation = 0;
var latLonBox = groundOverlay.getLatLonBox();
latLonBox.setBox(north, south, east, west, rotation);
//ge.getFeatures().appendChild(groundOverlay);
}
var pjs = 0;
function update(posnum) {
var mypos = new Array()
<!-- The Sciencenter -->
mypos[0] = [42.44958, -76.50435];
<!-- Taughannock Falls -->
mypos[1] = [42.54562, -76.59745];
<!-- Treman State Park -->
mypos[2] = [42.39750, -76.56117];
<!-- Myers Point -->
mypos[3] = [42.53702, -76.54832];
<!-- Trout Run, PA gas well -->
mypos[4] = [41.43452, -77.03942];
var center = new geo.Point(mypos[posnum][0] , mypos[posnum][1]);
if (pjs == 1) {
gex.dom.clearFeatures()
}
var placemarkJson = {}
var bounds = new geo.Bounds()
// there is some measure of accuracy, in meters
var bounds = new geo.Bounds();
var pts = [];
for (var heading = 0; heading <= 360; heading += 10) {
var circlePt = center.destination({ heading: heading,
distance: 1609.34 });
pts.push(circlePt);
if (heading % 90 == 0)
bounds.extend(circlePt);
}
placemarkJson.name = 'One Mile Radius';
placemarkJson.point = center;
placemarkJson.style = {
label: '#08f',
icon: {
color: '#08f',
stockIcon: 'shapes/placemark_circle'
}
}
placemarkJson.polygon = pts;
//placemarkJson.style = {};
placemarkJson.style.poly = { opacity: 0.3
, color: '#08f' };
placemarkJson.style.line = { opacity: .5, color: '#08f', width: 5 };
//placemarkJson.style.icon = { href: 'https://sciencenterfracking.appspot.com/static/drillpaths.gif' };
//console.log(placemarkJson.style.icon)
console.log(placemarkJson.style)
var pluginContainerNode = document.getElementById('map3d');
var boundsView = createBoundsView(ge, bounds,
pluginContainerNode.offsetWidth /
pluginContainerNode.offsetHeight);
ge.getView().setAbstractView(boundsView);
gex.dom.addPlacemark(placemarkJson);
pjs = 1;
var pluginContainerNode = document.getElementById('map3d');
var boundsView = createBoundsView(ge, bounds,
pluginContainerNode.offsetWidth /
pluginContainerNode.offsetHeight);
addoverlay(center)
}
function failureCallback(object) {
}
</script>
</head>
<body onload='init()' id='body'>
<center>
<div id='map3d' style='border: 1px solid silver; height: 600px; width: 800px;'></div>
Altitude (feet) <div id='id_alt_cam'></div>
<div>
<form id="place" action='javascript:void(0);'>
<button onclick='posnum=0;update(0)'> The Sciencenter</button>
<button onclick='posnum=1;update(1)'> Taughannock Falls</button>
<button onclick='posnum=2;update(2)'> Treman State Park</button>
<button onclick='posnum=3;update(3)'> Myers Point</button>
<button onclick='posnum=4;update(4)'> Trout Run, PA gas well</button>
</p></form>
</div>
</center>
</body>
</html>