VirtualSky
VirtualSky a browser-based planetarium from LCOGT that lets you see what is visible in the sky from any location on Earth. It can be customized and included on your own website, blog etc. It is provided freely for educational and non-profit use.
Keyboard shortcuts
Press the "?" key (with your mouse over VirtualSky) to see the full list of keyboard controls.
Instructions for embedding
The easiest way to include VirtualSky on your website is to use the custom form to create an embed link (uses an <iframe>).
Sometimes an <iframe> just doesn't give you the flexibility you need (or you might want to include it in an offline page during a public talk). In that case you could download a copy of the source from GitHub and include VirtualSky in your page using Javascript. You will need to include the following code block in the <head> of your page:
<!--[if lt IE 9]><script src="excanvas.min.js"></script><![endif]-->
<script src="jquery-1.10.0.min.js"></script>
<script src="virtualsky.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
	var planetarium = $.virtualsky({
		id: 'starmap1'
	});
});
</script>
Make sure the scripts point to the correct locations for the Javascript files. In the <body> you need to include the DOM element you've referenced by ID:
<div id="starmap1" style="width:400px;height:400px;"></div>
The result is:
That is a version of VirtualSky with all the default options. However, one of the great things about VirtualSky is that it can be customised. Here are some examples to give you some ideas:
- A stereoprojection set for Santa Barbara's lat/long:$(document).ready(function() { var planetarium = $.virtualsky({ id: 'starmap', projection: 'stereo', latitude: 34.4326, longitude: -119.86286 }); });<div id="starmap" style="width:100%;height:500px;"></div> 
- A lambertprojection, with constellations shown, no keyboard control and a black-on-white view. It is based in Manchester,UK and facing north:$(document).ready(function() { var planetarium = $.virtualsky({ id: 'starmap', projection: 'lambert', mouse: true, keyboard: false, az: 0, negative: true, constellations: true, latitude: 53.5, longitude: -2.5 }); });<div id="starmap" style="width:500px;height:300px;"></div> 
- A stereoprojection with no keyboard or mouse input and with a Galactic grid and the Meridian line displayed. The view is facing south east from Hill Valley, California at 1:21 am on October 25, 1985.$(document).ready(function() { var planetarium = $.virtualsky({ id: 'starmap', projection: 'stereo', keyboard: false, mouse: false, az: 135, meridian: true, latitude: 38.25, longitude: -122.6, clock: new Date("October 25, 1985 01:21:00"), gridlines_gal: true }); });<div id="starmap" style="width:650px;height:300px;"></div> 
- A mollweideprojection with with star labels drawn and the ground blocking half the sky.$(document).ready(function() { var planetarium = $.virtualsky({ id: 'starmap', projection: 'mollweide', showstarlabels: true, ground: true }); });<div id="starmap" style="width:920px;height:460px;"></div> 
- A default view with a stereoprojection, constellation lines and two manually specified constellation boundaries (note that RA/Dec for boundaries are assumed to be in B1875).$(document).ready(function() { var planetarium = $.virtualsky({ id: 'starmap', az: 225, projection: 'stereo', constellations: true, constellationboundaries: true, boundaries: [ ["And",343,34.5,343,52.5,350,52.5,350,50,353.75,50,353.75,48,2.5,48,2.5,46,13,46,13,48,16.75,48,16.75,50,20.5,50,25,50,25,47,30.625,47,30.625,50.5,37.75,50.5,37.75,36.75,30,36.75,30,35,21.125,35,21.125,33,10.75,33,10.75,23.75,12.75,23.75,12.75,21,2.125,21,2.125,22,1,22,1,28,0,28,0,31.33333,356.25,31.33333,356.25,32.08333,352.5,32.08333,352.5,34.5,343,34.5], ["Ori",69.25,0,69.25,15.5,74.5,15.5,74.5,16,80,16,80,15.5,84,15.5,84,12.5,86.5,12.5,86.5,18,85.5,18,85.5,22.83333,88.25,22.83333,88.25,21.5,93.25,21.5,93.25,17.5,94.625,17.5,94.625,12,94.625,10,93.625,10,93.625,0,93.625,-4,87.5,-4,87.5,-11,76.25,-11,76.25,-4,70,-4,70,0,69.25,0] ], clock:new Date("July 17, 2013 18:39:00 GMT") }); });<div id="starmap" style="width:944px;height:400px;"></div> 
- A default view using stereoprojection with a place marker$(document).ready(function() { var planetarium = $.virtualsky({ id: 'starmap', projection: 'stereo', }); planetarium.addPointer({ 'ra':83.8220792, 'dec':-5.3911111, 'label':'Orion Nebula', 'img':'http://server7.sky-map.org/imgcut?survey=DSS2&w=128&h=128&ra=5.58813861333333&de=-5.3911111&angle=1.25&output=PNG', 'url':'http://simbad.u-strasbg.fr/simbad/sim-id?Ident=M42', 'credit':'Wikisky', 'colour':'rgb(255,220,220)' }) });<div id="starmap" style="width:944px;height:400px;"></div> 
- A default view using gnomic-tanprojection centred on M42$(document).ready(function() { var planetarium = $.virtualsky({ 'id': 'starmap', 'projection': 'gnomic', 'ra': 83.8220833, 'dec': -5.3911111, 'ground': false, 'constellations': true, 'fov': 15 }); });<div id="starmap" style="width:944px;height:400px;"></div> 
- A default view using gnomic-tanprojection centred on Orion with a button to move$(document).ready(function() { var planetarium = $.virtualsky({ 'id': 'starmap', 'projection': 'gnomic', 'ra': 83.8220833, 'dec': -5.3911111, 'ground': false, 'constellations': true, 'fov': 15 }); $('button#moveit').on('click',function(){ planetarium.panTo(56.8690917,24.1053111,3000) }); });<div id="starmap" style="width:944px;height:400px;"></div> <button id="moveit">Move to The Pleiades</button> 
Options
There are a range of options to try (default values in brackets):
- id('starmap') - The ID for the HTML element where you want the sky inserted
- projection('polar') - The projection type as 'polar', 'stereo', 'lambert', 'ortho', 'equirectangular', 'mollweide', 'planechart' or 'fisheye'
- width(500) - Set the width of the sky unless you've set the width of the element
- height(250) - Set the height of the sky unless you've set the height of the element
- planets- either an object containing an array of planets or a JSON file
- magnitude(5) - the magnitude limit of displayed stars
- longitude(53.0) - the longitude of the observer
- latitude(-2.5) - the latitude of the observer
- clock(now) - a Javascript Date() object with the starting date/time
- background('rgba(0,0,0,0)') - the background colour
- transparent(false) - make the background transparent
- color('rgb(255,255,255)') - the text colour
- az(180) - an azimuthal offset with 0 = north and 90 = east
- negative(false) - invert the default colours i.e. to black on white
- gradient(true) - reduce the brightness of stars near the horizon
- ground(false) - show/hide the local ground (for full sky projections)
- keyboard(true) - allow keyboard controls
- mouse(true) - allow mouse controls
- cardinalpoints(true) - show/hide the N/E/S/W labels
- constellations(false) - show/hide the constellation lines
- constellationlabels(false) - show/hide the constellation labels
- constellationboundaries(false) - show/hide the constellation boundaries
- meteorshowers(false) - show/hide current meteor shower radiants
- showplanets(true) - show/hide the planets
- showplanetlabels(true) - show/hide the planet labels
- showorbits(false) - show/hide the orbits of the planets
- showstars(true) - show/hide the stars
- showstarlabels(false) - show/hide the star labels for the brightest stars
- scalestars(1) - the factor by which to scale the star sizes
- showdate(true) - show/hide the date and time
- showposition(true) - show/hide the latitude and longitude
- gridlines_az(false) - show/hide the azimuth/elevation grid lines
- gridlines_eq(false) - show/hide the RA/Dec grid lines
- gridlines_gal(false) - show/hide the Galactic grid lines
- gridstep(30) - the size of the grid step when showing grid lines
- ecliptic(false) - show the line of the Ecliptic
- meridian(false) - show the line of the Meridian
- showgalaxy(false) - show an outline of the Milky Way
- live(false) - update the display in real time
- fontsize- if, from a design point of view, you need a very specific font size (currently only in pixels), this is how you override the automatic font scaling. e.g. "10px"
- fontfamily- VirtualSky inherits the font family when it is added to an element on a page but can't when using an iframe. To solve that situation, you can provide a CSS- font-familystring.
Technical details
Virtual Sky uses the <canvas> element - part of the HTML5 proposal - so should work in most modern browsers such as Firefox (there are issues in Firefox 3.0 on Ubuntu), Opera, Chrome and Safari. It should also work in Internet Explorer 7.0 and 8.0 through the use of the excanvas.js library. The code can be found on Github.
Alternatives
There are other browser-based planetaria available online e.g. Ivan Boldyrev's Starchartjs, Luther Huffman's StarAtlas and Thomas Boch's All Sky Map. On the desktop, Stellarium is a highly featured planetarium program that works on Windows, Mac and Linux platforms.