A browser-based planetarium that can be customized and embedded in web pages. View as full-window. Some examples with code excerpts and some unit tests.
<html>
<head>
<!--[if lt IE 9]><script src="excanvas.js" type="text/javascript"></script><![endif]-->
<script src="jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="virtualsky.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
planetarium = $.virtualsky({id:'starmap',projection:'polar'}); // Assumes you want to draw this to a <div> with the id 'starmapper'
});
// -->
</script>
</head>
<body>
<div id="starmap" style="width:944x;height:400px;"></div>
</body>
</html>
The following options can be specified (defaults in brackets):
id
('starmap') - The ID for the HTML element where you want the sky insertedprojection
(polar
)- Polar -
polar
- Stereographic -
stereo
- with a fixed horizon - Lambert -
lambert
- with a fixed horizon - Equirectangular -
equirectangular
- Mollweide -
mollweide
- Plane chart -
planechart
- Orthographic -
ortho
- Fish-eye -
fisheye
- Polar -
width
(500) - Set the width of the sky unless you've set the width of the elementheight
(250) - Set the height of the sky unless you've set the height of the elementplanets
- either an object containing an array of planets or a JSON filemagnitude
(5) - the magnitude limit of displayed starslongitude
(53.0) - the longitude of the observerlatitude
(-2.5) - the latitude of the observerclock
(now) - a Javascript Date() object with the starting date/timebackground
('rgba(0,0,0,0)') - the background colouraz
(180) - an azimuthal offset with 0 = north and 90 = eastnegative
(false) - invert the default colours i.e. to black on whitesky_gradient
(true) - reduce the brightness of stars near the horizoncardinalpoints
(true) - show/hide the N/E/S/W labelsconstellations
(false) - show/hide the constellation linesconstellationlabels
(false) - show/hide the constellation labelsshowplanets
(true) - show/hide the planetsshowplanetlabels
(true) - show/hide the planetsshowstarlabels
(false) - show/hide the planetsshoworbits
(false) - show/hide the orbits of the planetsshowgalaxy
(false) - show/hide an outline of the Milky Wayshowdate
(true) - show/hide the date and timeshowposition
(true) - show/hide the latitude and longitudeground
(false) - show/hide the local ground (for full sky projections)keyboard
(true) - allow keyboard controlsmouse
(true) - allow mouse controlsgridlines_az
(false) - show/hide the azimuth/elevation grid linesgridlines_eq
(false) - show/hide the RA/Dec grid linesgridlines_gal
(false) - show/hide the Galactic Coordinate grid linesgridstep
(30) - the size of the grid step when showing grid linesra
(0) - the RA (degrees) for the centre of the view in gnomic projectiondec
(0) - the Declination (degrees) for the centre of the view in gnomic projectionfov
(30) - the vertical field-of-view (degrees) in the gnomic projectionfontsize
- set the font size in pixels if you want to over-ride the auto sizingfontfamily
- set the font family using a CSS style font-family string otherwise it inherits from the container elementobjects
- a semi-colon-separated string of recognized object names to display e.g. "M1;M42;Horsehead Nebula" (requires internet connection)
Stuart Lowe developed this at Las Cumbres Observatory and continues to maintain it in his spare time. LCO is a private operating foundation, building a global network of telescopes for professional research and citizen investigations.