mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-30 14:42:20 -08:00
56 lines
1.3 KiB
HTML
56 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
|
|
<link rel="stylesheet" href="../distrib/latest/aladin.min.css" />
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
|
|
|
|
|
<div id="aladin-lite-div" style="width: 700px; height: 600px"></div>
|
|
<script type="text/javascript" src="../distrib/latest/aladin.js" charset="utf-8"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var aladin = $.aladin('#aladin-lite-div', {target: "orion", fov: 5});
|
|
|
|
var parentDiv = aladin.getParentDiv();
|
|
var c = $("<canvas class='editor-canvas'></canvas>");
|
|
c[0].width = parentDiv.width();
|
|
c[0].height = parentDiv.height();
|
|
|
|
parentDiv.append(c);
|
|
|
|
c.css('z-index', '100');
|
|
c.css('position', 'absolute');
|
|
//c.css('pointer-events', 'none');
|
|
|
|
|
|
var ctx = c[0].getContext('2d');
|
|
ctx.beginPath();
|
|
ctx.moveTo(240, 240);
|
|
ctx.lineTo(400, 300);
|
|
ctx.lineTo(370, 430);
|
|
ctx.lineTo(290, 480);
|
|
ctx.closePath();
|
|
ctx.strokeStyle = 'lime';
|
|
ctx.lineWidth = 5;
|
|
ctx.stroke();
|
|
|
|
var overlay = A.graphicOverlay({color: 'red'});
|
|
aladin.addOverlay(overlay);
|
|
|
|
overlay.addFootprints(A.polygon([[83, -5.2], [85, -4.7], [85.7, -4], [83.2, -4.5]]));
|
|
//overlay.removeAll();
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|