Computer support Get pro-active monitoring software that identifies problems before they happen and fixes them before you even know they exist!
print cartridges Need ink cartridges for your printer? With us you can print away without worrying. Ring our freephone before 4pm for same day dispatch!
Cheap flights to Majorca Majorca has got a little something for everyone. As well as the legendary nightlife there are historical areas to explore. Check it out!
Holidays to Tenerife When you book with On The Beach, holidays to Tenerife are value for money. We won't be beaten on price! Check us out online.
bulgaria Property Visit us online for details on how to buy picturesque Bulgarian property in mountain ski resorts or seaside beach resorts.
Goa Flights Are you searching for flights to Goa? Use dealchecker.co.uk to compare airfare prices and find the best deal available! See online!
Rhodes Rhodes is one of the most visited of the choice of Greek islands. Why not take your next vacation to this warm and welcoming destination.
ARTICLES
Using Virtual Earth to Write a Vista Gadget That Tracks the International Space Station
This is the second part of two articles about writing Vista Gadgets that use Virtual Earth. The first part ("Using Virtual Earth in a Vista Gadget") showed you how to write a Vista Gadget that showed a simple interactive map using Virtual Earth. This second part extends the gadget into something more useful: A Tracker for the International Space Station (ISS).
At start up, the gadget automatically downloads the latest orbital parameters from the AmSat website.
The map is updated every half second with the ISS’s latest position. The position is tracked with a
pushpin shaped like the ISS. The map automatically pans to keep the ISS centered in the map. The user
may zoom in or out using "+" and "-" buttons. A "Refresh" button allows the orbital parameters to be
refreshed from AmSat. These orbital parameters should only be refreshed every few days -- you do not
need to do this if you restart Vista (and hence the gadget) on a daily basis.
Instead of two files, the gadget now contains ten files. One of these
is an image: ISS_pin.gif stores the image of the ISS pushpin. The remaining extra files (global.js,
graphic_clock.js, math.js, sgp4sdp4.js, time.js, utils.js, view.js ) are all JavaScript files used to
calculate the orbit of the ISS. These are based on the orbit calculation routines available from http://www.movingsatellites.com.
This gadget might seem quite a bit more complicated than the previous gadget. In reality it has the same overall structure. For example, here is our new manifest file:
The only change of consequence is that the main HTML source filename has been changed to "ISS_Tracker.html".
In turn, ISS_Tracker.html is based on the HTML file in our previous gadget. However, we need to add code to download the latest orbital data, make calls to the MovingSatellites.com code to calculate new positions, and to automatically update the map.
The gadget uses NORAD "TLE" (Two Line Element) Keplerian orbital parameters. This is a standard way of defining a satellite in Earth orbit in machine readable text form. A typical set of TLE parameters look like this:
The first line specifies the satellite name. The next two lines specify the parameters in a fixed format reminiscent of Fortran. These parameters can be obtained from a number of websites, including NORAD’s, but we shall get ours from the AmSat site. The URL for the file is: http://www.amsat.org/amsat/ftp/keps/current/nasa.all . We fetch this file using the ActiveX Microsoft.XMLHTTP object. Note that this is specific to Microsoft JScript. All Vista gadgets will use Jscript, but the ActiveX control will not necessarily be available in a traditional web browser environment (eg. Mozilla).
So let’s get to ISS_Tracker.html. Here is the beginning. As well as including the Virtual Earth control, we include the orbit calculation JScript files:
Next we get into our main JavaScript code with some global definitions and parameters:
The body section of the gadget is very similar to the previous Virtual Earth example. The body tag itself defines a call-back to onPageLoad(). We also have the two zoom buttons, and an empty div tag to hold the Virtual Earth map. New additions are a third button (“Refresh”) and a span tag to display the ISS’s coordinate position as a line of text.
And that is it! A few simple steps make the Virtual Earth gadget into a useful little tracking tool.