Repository navigation
Expand file tree
/
Copy pathcreateEarth.js
More file actions
69 lines (50 loc) · 1.83 KB
/
Copy pathcreateEarth.js
File metadata and controls
69 lines (50 loc) · 1.83 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
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
<!--//
function createPlacemark(job, name, lat, lon) {
var placemark = gex.dom.addPointPlacemark([lat, lon], { name: name, style: { icon: { stockIcon: "paddle/red-circle" }}});
google.earth.addEventListener(placemark, 'click', function(event) {
event.preventDefault();
var balloon = ge.createHtmlStringBalloon('');
balloon.setFeature(event.getTarget());
balloon.setMinWidth(200);
balloon.setMinHeight(200);
// html = '<div id="popup_window"></div><img src="./Html/clear.gif" onload="execute_ajax(\'display_content\', \'popup_window\', \'metagenome_id=METAGENOMEID\');"/>';
// re = /METAGENOMEID/;
// html = html.replace(re, job);
// balloon.setContentString(html);
balloon.setContentString('<a href="?page=MetagenomeOverview&metagenome='+job+'">'+name+'</a>');
ge.setBalloon(balloon);
});
}
function createView(lat, lon){
// Create a new LookAt
var lookAt = ge.createLookAt('');
// Set the position values
lookAt.setLatitude(lat);
lookAt.setLongitude(lon);
lookAt.setRange(100000.0); //default is 0.0
// Update the view in Google Earth
ge.getView().setAbstractView(lookAt);
}
function hide_show_ge(id, height){
var map = document.getElementById('map3d');
if(map.style.height == '0px'){
map.style.height = height+'px';
} else {
map.style.height = '0px';
}
}
//-->
var ge = null;
var gex = null;
google.load("earth", "1");
google.setOnLoadCallback(function() {
google.earth.createInstance('map3d', function(pluginInstance) {
ge = pluginInstance;
ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
gex = new GEarthExtensions(pluginInstance);
gex.util.lookAt([33, -117], { range: 25000000 });
for (i in args)
createPlacemark(args[i][0], args[i][1], args[i][2], args[i][3]);
}, function() {});
});