-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (48 loc) · 1.96 KB
/
index.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
<!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" style="width: 100%; height: 100%;margin:0;">
<head>
<title>Starchart test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body onload="onload()">
<div id="map-pane">
<!-- dammit, width and height cannot be replaced by CSS's width --
-- and height. -->
<canvas id="test-map800" width="800" height="800"></canvas>
</div>
<div id="coord"> </div>
<script type="text/javascript" src="constellations-rey60.js"></script>
<script type="text/javascript" src="messier.js"></script>
<script type="text/javascript" src="caldwell.js"></script>
<script type="text/javascript" src="boundaries-18.js"></script>
<script type="text/javascript" src="starmap.min.js?version=554852060e222217c07e64a4478ce66f"></script>
<script type="text/javascript">
var RAD = 800;
var map;
function onload() {
map = new StarMap("test-map800", RAD, REY_STARS60, REY_CONSTELLATIONS60, {messier: MESSIER, messier_colors: MESSIER_COLORS,caldwell: CALDWELL, caldwell_colors: MESSIER_COLORS});
map.setPos(83, 54);
map.setSize(RAD, RAD);
map.draw();
var el = document.getElementById("test-map800");
var out = document.getElementById("coord");
el.onmousemove = function (ev) {
//console.debug(ev);
if (!ev) var ev = window.event;
var h = RAD;
var x = ev.pageX - h - /* HACK */ 8;
var y = h - ev.pageY + /* HACK */ 8;
//var y = ev.pageY - h - 8;
var p = map.proj.inverseObj(x, y);
if (p) {
out.innerHTML = 'ra: '+(180*p.ra/Math.PI).toFixed(2)+
' de: '+(180*p.de/Math.PI).toFixed(2)+' ';
} else {
out.innerHTML = ' ';
}
//out.innerHTML += '('+x+', '+y+')';
};
}
</script>
</body>
</html>