Virtual Earth as Gadget for Windows Vista Sidebar

Johannes Kebeck's Blog
04-02-2008, 05:40 AM
<h1>Introduction</h1> <p>If you are using Windows Vista you probably had a look at the Sidebar Gadgets as well. <p><a href="http://blufiles.storage.msn.com/y1pLfDzppuxasgI194XPJbECLDMCFEi0dLG3Bqtuc-WTQ3FcjSkpocCI4Fb2cm0hZaoySVKN60uELo?PARTNER=WRITE R"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=210 alt=image src="http://blufiles.storage.msn.com/y1pLfDzppuxasiVhX5Gh279awZMYLk97PW_fvO0mJOJP5Osd1I sfdTCwr-vzOvWgabsC0EMKg6KOt0?PARTNER=WRITER" width=154 border=0></a> <p>There is a already pretty <a href="http://vista.gallery.microsoft.com/vista/SideBar.aspx">big gallery available on the web</a> but since the Gadgets are basically small HTML-documents automated through JavaScript everybody can build his own Gadgets as well. I like the idea of having some condensed information in one place and open a Flyout which get's you full functionality in a bigger window. Of course I was aware that there are already Gadgets which implement some of the Virtual Earth functions so I wanted to demonstrate how easy it can be to implement your own existing Virtual Earth applications in the Sidebar. As a starting point we use the tracking application which I described in a <a href="http://johanneskebeck.spaces.live.com/blog/cns!42E1F70205EC8A96!3749.entry">previous posting</a>. The idea is to have a small Gadget as shown above in the Sidebar and then to create a Flyout in which I have advanced functionality like replaying previous days. <h1>Getting Started</h1> <p>If you are new to the Vista Gadgets <a href="http://msdn2.microsoft.com/en-us/library/aa965850(VS.85).aspx">this might be a good starting point</a> but don't worry it is pretty easy and the following steps will be explained in detail. As mentioned before, we will build upon the code for that simple tracking application which I have described <a href="http://johanneskebeck.spaces.live.com/blog/cns!42E1F70205EC8A96!3749.entry">here</a>. In the meantime I had modified that sample so that we have a replay-function as well. You will find the source code <a href="http://cid-42e1f70205ec8a96.skydrive.live.com/self.aspx/Public/VE-Tracking.zip">here</a>: <p> <h1>The Gadget</h1> <p>Particularly for development and testing it is a good idea to create a folder directly in your personal Gadget-folder (e.g. C:\Users\jkebeck\AppData\Local\Microsoft\Windows Sidebar\Gadgets) rather than in the standard repository for your Visual Studio project. The folder shall follow the naming convention "SomeName.gadget". In my case it is "MyTracking.gadget". <h2>The Manifest (gadget.xml)</h2> <p>The first piece of the Gadget is the XML-Manifest which describes where everything is. <u>The name of this file must always be gadget.xml</u>. A detailed description of the manifest can be found <a href="http://msdn2.microsoft.com/en-us/library/bb508509(VS.85).aspx">here</a> and my manifest looks like this:<pre><span style="color:blue"><?</span><span style="color:#a31515">xml </span><span style="color:red">version</span><span style="color:blue">=</span>"<span style="color:blue">1.0</span>" <span style="color:red">encoding</span><span style="color:blue">=</span>"<span style="color:blue">utf-8</span>" <span style="color:blue">?>
<</span><span style="color:#a31515">gadget</span><span style="color:blue">>
<</span><span style="color:#a31515">name</span><span style="color:blue">></span>Where is Hannes?<span style="color:blue"></</span><span style="color:#a31515">name</span><span style="color:blue">>
<</span><span style="color:#a31515">version</span><span style="color:blue">></span>1.0.0.0<span style="color:blue"></</span><span style="color:#a31515">version</span><span style="color:blue">>
<</span><span style="color:#a31515">author </span><span style="color:red">name</span><span style="color:blue">=</span>"<span style="color:blue">Johannes Kebeck</span>"<span style="color:blue">>
<</span><span style="color:#a31515">info </span><span style="color:red">url</span><span style="color:blue">=</span>"<span style="color:blue">http://johanneskebeck.spaces.live.com</span>" <span style="color:red">text</span><span style="color:blue">=</span>"<span style="color:blue">My Blog</span>" <span style="color:blue">/>
<</span><span style="color:#a31515">logo </span><span style="color:red">src</span><span style="color:blue">=</span>"<span style="color:blue">logo.jpg</span>" <span style="color:blue">/>
</</span><span style="color:#a31515">author</span><span style="color:blue">>
<</span><span style="color:#a31515">copyright</span><span style="color:blue">></span><span style="color:red">© </span>feel free to re-use<span style="color:blue"></</span><span style="color:#a31515">copyright</span><span style="color:blue">>
<</span><span style="color:#a31515">description</span><span style="color:blue">></span>The Vista-Sidebar-Gadget-Version of my Tracking Sample<span style="color:blue"></</span><span style="color:#a31515">description</span><span style="color:blue">>
<</span><span style="color:#a31515">icons</span><span style="color:blue">>
<</span><span style="color:#a31515">icon </span><span style="color:red">width</span><span style="color:blue">=</span>"<span style="color:blue">64</span>" <span style="color:red">height</span><span style="color:blue">=</span>"<span style="color:blue">64</span>" <span style="color:red">src</span><span style="color:blue">=</span>"<span style="color:blue">icon.jpg</span>" <span style="color:blue">/>
</</span><span style="color:#a31515">icons</span><span style="color:blue">>
<</span><span style="color:#a31515">hosts</span><span style="color:blue">>
<</span><span style="color:#a31515">host </span><span style="color:red">name</span><span style="color:blue">=</span>"<span style="color:blue">sidebar</span>"<span style="color:blue">>
<</span><span style="color:#a31515">base </span><span style="color:red">type</span><span style="color:blue">=</span>"<span style="color:blue">HTML</span>" <span style="color:red">apiVersion</span><span style="color:blue">=</span>"<span style="color:blue">1.0.0</span>" <span style="color:red">src</span><span style="color:blue">=</span>"<span style="color:blue">gadget.html</span>" <span style="color:blue">/>
<</span><span style="color:#a31515">permissions</span><span style="color:blue">></span>Full<span style="color:blue"></</span><span style="color:#a31515">permissions</span><span style="color:blue">>
<</span><span style="color:#a31515">platform </span><span style="color:red">minPlatformVersion</span><span style="color:blue">=</span>"<span style="color:blue">1.0</span>" <span style="color:blue">/>
</</span><span style="color:#a31515">host</span><span style="color:blue">>
</</span><span style="color:#a31515">hosts</span><span style="color:blue">>
</</span><span style="color:#a31515">gadget</span><span style="color:blue">></span></pre><a href="http://11011.net/software/vspaste"></a>
<p>
<p>As you can see the source of the gadget has to be a HTML-file and I called it gadget.html but you can choose any other name as well.
<h2>The HTML-document for the Gadget (gadget.html)</h2>
<p>As you can see the source of the gadget is a very basic HTML-document. It contains references to a style-sheet, the Virtual Earth MapControl and our own JavaScript-file which we have still to create. In the body we have a DIV-element for the title as well as another DIV-element which will host the Virtual Earth MapControl. The DIV-element for the title also contains a link to a JavaScript-function which will be discussed later.<pre><span style="color:blue"><</span><span style="color:#a31515">html</span><span style="color:blue">>
<</span><span style="color:#a31515">head</span><span style="color:blue">>
<</span><span style="color:#a31515">meta </span><span style="color:red">http-equiv</span><span style="color:blue">="Content-Type" </span><span style="color:red">content</span><span style="color:blue">="text/html; charset=Unicode" />
<</span><span style="color:#a31515">title</span><span style="color:blue">></span>Hannes Tracking Gadget<span style="color:blue"></</span><span style="color:#a31515">title</span><span style="color:blue">>
<</span><span style="color:#a31515">link </span><span style="color:red">href</span><span style="color:blue">="gadget.css" </span><span style="color:red">rel</span><span style="color:blue">="stylesheet" </span><span style="color:red">type</span><span style="color:blue">="text/css" />
<</span><span style="color:#a31515">script </span><span style="color:red">src</span><span style="color:blue">="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6" </span><span style="color:red">type</span><span style="color:blue">="text/javascript"></</span><span style="color:#a31515">script</span><span style="color:blue">>
<</span><span style="color:#a31515">script </span><span style="color:red">src</span><span style="color:blue">="gadget.js" </span><span style="color:red">type</span><span style="color:blue">="text/javascript"></</span><span style="color:#a31515">script</span><span style="color:blue">>
</</span><span style="color:#a31515">head</span><span style="color:blue">>
<</span><span style="color:#a31515">body</span><span style="color:blue">>
<</span><span style="color:#a31515">div </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">font-weight</span>:<span style="color:blue">bold</span>; <span style="color:red">text-align</span>:<span style="color:blue">center</span>; <span style="color:red">width</span>:<span style="color:blue">130px"><</span><span style="color:#a31515">a </span><span style="color:red">href</span><span style="color:blue">='#' </span><span style="color:red">onclick</span><span style="color:blue">='javascript:showFlyout();'></span>Where is Hannes?<span style="color:blue"></</span><span style="color:#a31515">a</span><span style="color:blue">></</span><span style="color:#a31515">div</span><span style="color:blue">><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">div </span><span style="color:red">id</span><span style="color:blue">='divMap' </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">position</span>:<span style="color:blue">absolute</span>; <span style="color:red">top</span>:<span style="color:blue">20px</span>; <span style="color:red">left</span>:<span style="color:blue">0px</span>; <span style="color:red">width</span>:<span style="color:blue">130px</span>; <span style="color:red">height</span>:<span style="color:blue">130px</span>;<span style="color:blue">"></</span><span style="color:#a31515">div</span><span style="color:blue">>
</</span><span style="color:#a31515">body</span><span style="color:blue">>
</</span><span style="color:#a31515">html</span><span style="color:blue">></span></pre><a href="http://11011.net/software/vspaste"></a>
<h2>The CSS for the Gadget (gadget.css)</h2>
<p>Docked gadgets must be at least 60 pixels high and anywhere from 25 pixels to 130 pixels wide to fit within the maximum width of the Sidebar. The size of the gadget is defined by the height and width of the HTML-body. As you can see in the CSS below I override the styles for scalebar, copyrights and logo. This is something that you should normally never do and in fact it violates the <a href="http://www.microsoft.com/virtualearth/product/terms.html">Terms of Use</a> but since the map in my sidebar is so small that the attribution would obstruct the map completely and since my flyout will have the complete attribution anyway, I hope that it is OK. My Style-sheet looks like this. <pre><span style="color:#a31515">html
</span>{
<span style="color:red">overflow</span>:<span style="color:blue">hidden</span>;
}

<span style="color:#a31515">body
</span>{
<span style="color:red">font-family</span>:<span style="color:blue">Tahoma</span>;
<span style="color:red">font-size</span>:<span style="color:blue">12px</span>;
<span style="color:red">background-color</span>:<span style="color:blue">#464646</span>;
<span style="color:red">color</span>:<span style="color:blue">#FFFFFF</span>;
<span style="color:red">position</span>:<span style="color:blue">absolute</span>;
<span style="color:red">left</span>:<span style="color:blue">0px</span>;
<span style="color:red">top</span>:<span style="color:blue">0px</span>;
<span style="color:red">margin-left</span>:<span style="color:blue">0px</span>;
<span style="color:red">margin-top</span>:<span style="color:blue">0px</span>;
<span style="color:red">width</span>:<span style="color:blue">130px</span>;
<span style="color:red">height</span>:<span style="color:blue">150px</span>;
}

<span style="color:#a31515">h1
</span>{
<span style="color:red">font-family</span>:<span style="color:blue">Tahoma</span>;
<span style="color:red">text-align</span>:<span style="color:blue">center</span>;
}

<span style="color:green">/* Set Link-Colors */
</span><span style="color:#a31515">a:link </span>{<span style="color:red">color</span>:<span style="color:blue">#FFFFFF</span>}
<span style="color:#a31515">a:visited </span>{<span style="color:red">color</span>:<span style="color:blue">#FFFFFF</span>}
<span style="color:#a31515">a:hover </span>{<span style="color:red">color</span>:<span style="color:blue">#FFFF00</span>}
<span style="color:#a31515">a:active </span>{<span style="color:red">color</span>:<span style="color:blue">#FFFFFF</span>}

<span style="color:green">/* Removing the Microsoft logo, scalebar, and copyright logos off of the map */
</span><span style="color:#a31515">#divMap .MSVE_PoweredByLogo
</span>{
<span style="color:red">display</span>:<span style="color:blue">none</span>;
}
<span style="color:#a31515">#divMap .MSVE_ScaleBar
</span>{
<span style="color:red">display</span>:<span style="color:blue">none</span>;
}
<span style="color:#a31515">#divMap .MSVE_ScaleBarLabel
</span>{
<span style="color:red">display</span>:<span style="color:blue">none</span>;
}
<span style="color:#a31515">#divMap .MSVE_Copyright
</span>{
<span style="color:red">display</span>:<span style="color:blue">none</span>;
}</pre><a href="http://11011.net/software/vspaste"></a>
<h2>The JavaScript for the Gadget (gadget.js)</h2>
<p>The first difference you see is the reference to the flyout-document. The rest is pretty much the same as the original website for my tracking application which was explained in my <a href="http://johanneskebeck.spaces.live.com/blog/cns!42E1F70205EC8A96!3749.entry">previous posting</a> with a few exceptions:
<ul>
<li>The default size of the dashboard would be too big for the gadget so I choose a smaller size:<br>* map.SetDashboardSize(VEDashboardSize.Tiny);<br>Alternatively you could switch of the interactivity of the map completely which would remove the dashboard and disable all mouse- and keyboard-events:<br>* map.LoadMap(<span style="color:blue">new </span>VELatLong(51.461962075378054, -0.9260702133178665), 13, VEMapStyle.Shaded, true);
<li>I added a function showFlyout(). This function is being executed when you click on the link in the title of the gadget and will basically open the flyout windows.</ul><pre>window.onload = GetMap;

<span style="color:green">//TheGadget Flyout-file
</span>System.Gadget.Flyout.file = <span style="color:#a31515">"flyout.html"</span>;

<span style="color:green">//Map
</span><span style="color:blue">var </span>map = <span style="color:blue">null</span>;

<span style="color:green">//VEShapeLayer
</span><span style="color:blue">var </span>slTracks = <span style="color:blue">new </span>VEShapeLayer();

<span style="color:blue">function </span>GetMap()
{
map = <span style="color:blue">new </span>VEMap(<span style="color:#a31515">'divMap'</span>);
map.SetDashboardSize(VEDashboardSize.Tiny);
map.LoadMap(<span style="color:blue">new </span>VELatLong(51.461962075378054, -0.9260702133178665), 13, VEMapStyle.Shaded);
map.AddShapeLayer(slTracks);
<span style="color:green">//Start Tracking and Set Intervall to 5 minutes
</span>showtime=setInterval(<span style="color:#a31515">"Track()"</span>, 300000);
Track();
}

<span style="color:green">//Tracking
</span><span style="color:blue">function </span>Track()
{
<span style="color:green">//Delete previous tracks
</span>slTracks.DeleteAllShapes();

<span style="color:green">//Build the URL
//The random URL-parameter avoids caching
</span><span style="color:blue">var </span>url=<span style="color:#a31515">"http://YourServer/Tracking.ashx?" </span>+ Math.random();

<span style="color:green">//Get the appropriate XMLHTTP object for the browser
</span><span style="color:blue">var </span>xmlhttp = GetXmlHttp();

<span style="color:green">//if we have a valid XMLHTTP object
</span><span style="color:blue">if </span>(xmlhttp)
{
xmlhttp.Open(<span style="color:#a31515">"GET"</span>, url, <span style="color:blue">true</span>); <span style="color:green">//varAsynx = true

//set the callback
</span>xmlhttp.onreadystatechange = <span style="color:blue">function</span>()
{
<span style="color:blue">if </span>(xmlhttp.readystate ==4) <span style="color:green">//4 is a success
</span>{
<span style="color:green">//server code creates JavaScript "on the fly" for us to
//execute using eval()
</span><span style="color:blue">var </span>result = xmlhttp.responseText
eval(result);
}
}
xmlhttp.send(<span style="color:blue">null</span>);
}
}

<span style="color:blue">function </span>GetXmlHttp()
{
<span style="color:blue">var </span>x = <span style="color:blue">null</span>;
<span style="color:blue">try
</span>{
x = <span style="color:blue">new </span>ActiveXObject(<span style="color:#a31515">"Msxml2.XMLHTTP"</span>);
}
<span style="color:blue">catch </span>(e)
{
<span style="color:blue">try
</span>{
x = <span style="color:blue">new </span>ActiveXObject(<span style="color:#a31515">"Microsoft.XMLHTTP"</span>);
}
<span style="color:blue">catch </span>(e)
{
x = <span style="color:blue">null</span>;
}
}
<span style="color:blue">if </span>(!x && <span style="color:blue">typeof </span>XMLHttpRequest != <span style="color:#a31515">"undefined"</span>)
{
x = <span style="color:blue">new </span>XMLHttpRequest();
}
<span style="color:blue">return </span>x;
}

<span style="color:blue">function </span>showFlyout()
{
System.Gadget.Flyout.show = <span style="color:blue">true</span>;
}</pre><a href="http://11011.net/software/vspaste"></a>
<p>All right that's already the first part. Click in the "+" symbol in the sidebar to bring up the "Gadget Gallery".
<p><a href="http://blufiles.storage.msn.com/y1pLfDzppuxasjTOLFmTTbmEr3ECigN5IStFC1F-1E_BBj-KQ7vdN8VjdVQszz1P3K-xK55wHNQ6ec?PARTNER=WRITER"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=26 alt=image src="http://blufiles.storage.msn.com/y1pLfDzppuxash0smKyZLPiIASfp-F7qi3dcrALZYbuT-Ht0hzqPegMNiFkpXb6QcszKPEW7-AbJjU?PARTNER=WRITER" width=154 border=0></a>
<p>Your new gadget should be visible. Double-click to add it to the sidebar or just drag-and-drop it onto the sidebar.
<p><a href="http://blufiles.storage.msn.com/y1pLfDzppuxasix_6md810tmRxHsuE0TxN1w0Iy2psw8iLJzTO sEYauAbDsjdGOYs7zinqIsQRBXPU?PARTNER=WRITER"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=484 alt=image src="http://eayyzw.blu.livefilestore.com/y1psLOdC392akqdquNLtM96o9ZLAZTzXpg0WcVsltUCrUCV7zS PlD0e-Bhj1_VxWxxkECzh6D936PxazXTHE7scAg?PARTNER=WRITER" width=603 border=0></a>
<h1>The Flyout</h1>
<p>The flyout is a bigger window which will appear when you set the property "System.Gadget.Flyout.show = <span style="color:blue">true</span>;" It will be attached to the docked gadget in the sidebar and is often used to configure the content of the docked gadget or - as in my example - to provide additional information and functions. The approach is very similar to the docked gadget mentioned above and I will use the main web site for the tracking application which I <a href="http://johanneskebeck.spaces.live.com/blog/cns!42E1F70205EC8A96!3749.entry">described previously</a> a a template.
<h2>The HTML-document for Flyout (flyout.html)</h2>
<p>Well the original posting was just providing the tracking functionality and not the function to replay a day so we will have to make some modifications to provide a replay of previous days. In the header we reference the Virtual Earth MapControl as well as our own CSS and JavaScript.
<p><em><u>Please note:</u> even though we did define the style for background-colour in the external CSS this would not be applied to the flyout. Apparently this is a bug in the sidebar. The workaround is to define the style in the HTML-document directly.</em>
<p>The body contains a first DIV-element which is basically a header. The second DIV-element contains some checkboxes to start and stop live tracking as well as a replay of a previous day. The days which are available for replay - i.e. the days when I had my GPS switched on - will be displayed in an HTML-SELECT-element. And finally there is a DIV-element which will host our Virtual Earth map.<pre><span style="color:blue"><!</span><span style="color:#a31515">DOCTYPE </span><span style="color:red">html PUBLIC </span><span style="color:blue">"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<</span><span style="color:#a31515">html </span><span style="color:red">xmlns</span><span style="color:blue">="http://www.w3.org/1999/xhtml">
<</span><span style="color:#a31515">head</span><span style="color:blue">>
<</span><span style="color:#a31515">title</span><span style="color:blue">></span>Tracking Gadget<span style="color:blue"></</span><span style="color:#a31515">title</span><span style="color:blue">>
<</span><span style="color:#a31515">link </span><span style="color:red">href</span><span style="color:blue">="flyout.css" </span><span style="color:red">rel</span><span style="color:blue">="stylesheet" </span><span style="color:red">type</span><span style="color:blue">="text/css" />
<</span><span style="color:#a31515">script </span><span style="color:red">src</span><span style="color:blue">="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6" </span><span style="color:red">type</span><span style="color:blue">="text/javascript"></</span><span style="color:#a31515">script</span><span style="color:blue">>
<</span><span style="color:#a31515">script </span><span style="color:red">src</span><span style="color:blue">="flyout.js" </span><span style="color:red">type</span><span style="color:blue">="text/javascript"></</span><span style="color:#a31515">script</span><span style="color:blue">>
</</span><span style="color:#a31515">head</span><span style="color:blue">>
<</span><span style="color:#a31515">body </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">background-color</span>:<span style="color:blue">#5b86ce">
<</span><span style="color:#a31515">div </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">position</span>:<span style="color:blue">absolute</span>; <span style="color:red">top</span>:<span style="color:blue">0px</span>; <span style="color:red">left</span>:<span style="color:blue">0px</span>; <span style="color:red">width</span>:<span style="color:blue">100%</span>; <span style="color:red">height</span>:<span style="color:blue">60px</span>;<span style="color:blue">" </span><span style="color:red">class</span><span style="color:blue">="header">
<</span><span style="color:#a31515">table </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">width</span>:<span style="color:blue">100%" >
<</span><span style="color:#a31515">tr </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">vertical-align</span>:<span style="color:blue">top">
<</span><span style="color:#a31515">td </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">width</span>:<span style="color:blue">140px</span>; <span style="color:red">min-width</span>:<span style="color:blue">140px"><</span><span style="color:#a31515">img </span><span style="color:red">src</span><span style="color:blue">="VirtualEarth.gif" </span><span style="color:red">alt</span><span style="color:blue">="Virtual Earth Logo" </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">margin-left</span>:<span style="color:blue">5px</span>;<span style="color:blue">" /></</span><span style="color:#a31515">td</span><span style="color:blue">>
<</span><span style="color:#a31515">td</span><span style="color:blue">><</span><span style="color:#a31515">h1 </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">min-width</span>:<span style="color:blue">400px"></span>Tracking Gadget<span style="color:blue"></</span><span style="color:#a31515">h1</span><span style="color:blue">></</span><span style="color:#a31515">td</span><span style="color:blue">>
<</span><span style="color:#a31515">td </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">width</span>:<span style="color:blue">140px</span>; <span style="color:red">min-width</span>:<span style="color:blue">140px</span>; <span style="color:red">text-align</span>:<span style="color:blue">right"><</span><span style="color:#a31515">a</span><span style="color:blue">></span>Version 6<span style="color:blue"><</span><span style="color:#a31515">br </span><span style="color:blue">/></</span><span style="color:#a31515">a</span><span style="color:blue">></</span><span style="color:#a31515">td</span><span style="color:blue">>
</</span><span style="color:#a31515">tr</span><span style="color:blue">>
</</span><span style="color:#a31515">table</span><span style="color:blue">>
</</span><span style="color:#a31515">div</span><span style="color:blue">>
<</span><span style="color:#a31515">div </span><span style="color:red">id</span><span style="color:blue">='divCtrl' </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">position</span>:<span style="color:blue">absolute</span>; <span style="color:red">top</span>:<span style="color:blue">65px</span>; <span style="color:red">left</span>:<span style="color:blue">5px</span>; <span style="color:red">width</span>:<span style="color:blue">195px</span>; <span style="color:red">height</span>:<span style="color:blue">400px</span>;<span style="color:blue">">
<</span><span style="color:#a31515">input </span><span style="color:red">id</span><span style="color:blue">="cbTracking" </span><span style="color:red">type</span><span style="color:blue">="checkbox" </span><span style="color:red">onclick</span><span style="color:blue">="StartStopTracking('cbTracking')" /></span>Start/Stop Tracking<span style="color:blue"><</span><span style="color:#a31515">br </span><span style="color:blue">/><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">hr </span><span style="color:blue">/><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">b</span><span style="color:blue">></span>Select a day for replay<span style="color:blue"></</span><span style="color:#a31515">b</span><span style="color:blue">><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">select </span><span style="color:red">id</span><span style="color:blue">="ddReplayDate" </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">width</span>:<span style="color:blue">190px"></</span><span style="color:#a31515">select</span><span style="color:blue">><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">input </span><span style="color:red">id</span><span style="color:blue">="cbReplay" </span><span style="color:red">type</span><span style="color:blue">="checkbox" </span><span style="color:red">onclick</span><span style="color:blue">="StartStopReplay('cbReplay')" /></span>Start/Stop Replay<span style="color:blue"><</span><span style="color:#a31515">br </span><span style="color:blue">/><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">hr </span><span style="color:blue">/><</span><span style="color:#a31515">br </span><span style="color:blue">/>
<</span><span style="color:#a31515">a </span><span style="color:red">href</span><span style="color:blue">='#' </span><span style="color:red">onclick</span><span style="color:blue">='javascript:hideFlyout();'></span>Close Flyout<span style="color:blue"></</span><span style="color:#a31515">a</span><span style="color:blue">>
</</span><span style="color:#a31515">div</span><span style="color:blue">>
<</span><span style="color:#a31515">div </span><span style="color:red">id</span><span style="color:blue">='divMap' </span><span style="color:red">style</span><span style="color:blue">="</span><span style="color:red">position</span>:<span style="color:blue">absolute</span>; <span style="color:red">top</span>:<span style="color:blue">65px</span>; <span style="color:red">left</span>:<span style="color:blue">205px</span>; <span style="color:red">width</span>:<span style="color:blue">590px</span>; <span style="color:red">height</span>:<span style="color:blue">530px</span>;<span style="color:blue">"></</span><span style="color:#a31515">div</span><span style="color:blue">>
</</span><span style="color:#a31515">body</span><span style="color:blue">>
</</span><span style="color:#a31515">html</span><span style="color:blue">></span></pre>
<h2>The CSS for the Flyout (flyout.css)</h2>
<p>There are no surprises in the CSS. As mentioned before the height and width of the body determine the size of the flyout-window.<pre><span style="color:#a31515">html
</span>{
<span style="color:red">overflow</span>:<span style="color:blue">hidden</span>;
}

<span style="color:#a31515">body
</span>{
<span style="color:red">font-family</span>:<span style="color:blue">Tahoma</span>;
<span style="color:red">font-size</span>:<span style="color:blue">12px</span>;
<span style="color:red">background-color</span>:<span style="color:blue">#5b86ce</span>;
<span style="color:red">color</span>:<span style="color:blue">#00284A</span>;
<span style="color:red">position</span>:<span style="color:blue">absolute</span>;
<span style="color:red">left</span>:<span style="color:blue">0px</span>;
<span style="color:red">top</span>:<span style="color:blue">0px</span>;
<span style="color:red">margin-left</span>:<span style="color:blue">0px</span>;
<span style="color:red">margin-top</span>:<span style="color:blue">0px</span>;
<span style="color:red">width</span>:<span style="color:blue">800px</span>;
<span style="color:red">height</span>:<span style="color:blue">600px</span>;
}

<span style="color:#a31515">h1
</span>{
<span style="color:red">font-family</span>:<span style="color:blue">Tahoma</span>;
<span style="color:red">text-align</span>:<span style="color:blue">center</span>;
}

<span style="color:#a31515">.header
</span>{
<span style="color:red">font-family</span>:<span style="color:blue">Tahoma</span>;
<span style="color:red">background-color</span>:<span style="color:blue">#00284A</span>;
<span style="color:red">color</span>:<span style="color:blue">#5b86ce</span>;
}
</pre><a href="http://11011.net/software/vspaste"></a>
<p>a
<h2>The JavaScript for the Flyout (flyout.js)</h2>
<p>The live-tracking part is the same as in the docked gadget with the exception that I use the default dashboard-size for the map and that I provide a checkbox which allows me to start and stop tracking.
<p>I also call a function GetDates(). This function creates an AJAX-call to a new web-handler (GetDates.ashx). The source for that web handler is included in the sample code linked above and also listed at the end of this posting. It basically connects to the database and executes a "SELECT DISTINCT GPSdate FROM Tracks ORDER BY GPSdate DESC". The result will be used to create a JavaScript which populates my HTML-SELECT-element in the flyout.html site with the available days for replay. The general approach to integrate Virtual Earth with a database is described in <a href="http://johanneskebeck.spaces.live.com/blog/cns!42E1F70205EC8A96!1822.entry">one of my previous posting</a>.
<p>Another AJAX-call will be executed when the checkbox for the replay is activated. It calls my web handler Replay.ashx. This web handler is as well included the sample code linked above and listed at the end of this posting.
<p>Finally there is also a JavaScript hideFlyout() which allows us to close the Flyout-window but in fact the flyout would be closed anyway when the flyout-window looses it's focus.<pre>window.onload = GetMap;

<span style="color:green">//Map
</span><span style="color:blue">var </span>map = <span style="color:blue">null</span>;

<span style="color:green">//VEShapeLayer
</span><span style="color:blue">var </span>slTracks = <span style="color:blue">new </span>VEShapeLayer();

<span style="color:blue">function </span>GetMap()
{
<span style="color:green">//Populate Dropdown-List
</span>GetDates();

map = <span style="color:blue">new </span>VEMap(<span style="color:#a31515">'divMap'</span>);
map.LoadMap(<span style="color:blue">new </span>VELatLong(51.461962075378054, -0.9260702133178665), 13, VEMapStyle.Shaded);
map.AddShapeLayer(slTracks);
}

<span style="color:green">//Start/Stop Tracking
</span><span style="color:blue">function </span>StartStopTracking(control)
{
<span style="color:blue">if </span>(document.getElementById(control).checked == <span style="color:blue">false</span>) {
clearInterval(showtime);
slTracks.DeleteAllShapes();
}
<span style="color:blue">else </span>{
<span style="color:green">//Start Tracking and Set Intervall to 5 minutes
</span>showtime=setInterval(<span style="color:#a31515">"Track()"</span>, 300000);
Track();
}
}

<span style="color:green">//Tracking
</span><span style="color:blue">function </span>Track()
{
<span style="color:green">//Delete previous tracks
</span>slTracks.DeleteAllShapes();

<span style="color:green">//Build the URL
//The random URL-parameter avoids caching
</span><span style="color:blue">var </span>url=<span style="color:#a31515">"http://YourServer/Tracking.ashx?" </span>+ Math.random();

<span style="color:green">//Get the appropriate XMLHTTP object for the browser
</span><span style="color:blue">var </span>xmlhttp = GetXmlHttp();

<span style="color:green">//if we have a valid XMLHTTP object
</span><span style="color:blue">if </span>(xmlhttp)
{
xmlhttp.Open(<span style="color:#a31515">"GET"</span>, url, <span style="color:blue">true</span>); <span style="color:green">//varAsynx = true

//set the callback
</span>xmlhttp.onreadystatechange = <span style="color:blue">function</span>()
{
<span style="color:blue">if </span>(xmlhttp.readystate ==4) <span style="color:green">//4 is a success
</span>{
<span style="color:green">//server code creates JavaScript "on the fly" for us to
//execute using eval()
</span><span style="color:blue">var </span>result = xmlhttp.responseText
eval(result);
}
}
xmlhttp.send(<span style="color:blue">null</span>);
}
}

<span style="color:blue">function </span>GetXmlHttp()
{
<span style="color:blue">var </span>x = <span style="color:blue">null</span>;
<span style="color:blue">try
</span>{
x = <span style="color:blue">new </span>ActiveXObject(<span style="color:#a31515">"Msxml2.XMLHTTP"</span>);
}
<span style="color:blue">catch </span>(e)
{
<span style="color:blue">try
</span>{
x = <span style="color:blue">new </span>ActiveXObject(<span style="color:#a31515">"Microsoft.XMLHTTP"</span>);
}
<span style="color:blue">catch </span>(e)
{
x = <span style="color:blue">null</span>;
}
}
<span style="color:blue">if </span>(!x && <span style="color:blue">typeof </span>XMLHttpRequest != <span style="color:#a31515">"undefined"</span>)
{
x = <span style="color:blue">new </span>XMLHttpRequest();
}
<span style="color:blue">return </span>x;
}

<span style="color:green">//Fill DropDownList
</span><span style="color:blue">function </span>GetDates()
{
<span style="color:green">//Build the URL
//The random URL-parameter avoids caching
</span><span style="color:blue">var </span>url=<span style="color:#a31515">"http://YourServer/GetDates.ashx?" </span>+ Math.random();
<span style="color:green">
//Get the appropriate XMLHTTP object for the browser
</span><span style="color:blue">var </span>xmlhttp = GetXmlHttp();

<span style="color:green">//if we have a valid XMLHTTP object
</span><span style="color:blue">if </span>(xmlhttp)
{
xmlhttp.Open(<span style="color:#a31515">"GET"</span>, url, <span style="color:blue">true</span>); <span style="color:green">//varAsynx = true

//set the callback
</span>xmlhttp.onreadystatechange = <span style="color:blue">function</span>()
{
<span style="color:blue">if </span>(xmlhttp.readystate ==4) <span style="color:green">//4 is a success
</span>{
<span style="color:green">//server code creates JavaScript "on the fly" for us to
//execute using eval()
</span><span style="color:blue">var </span>result = xmlhttp.responseText
eval(result);
}
}
xmlhttp.send(<span style="color:blue">null</span>);
}
}

<span style="color:green">//Start/Stop Replay
</span><span style="color:blue">function </span>StartStopReplay(control)
{
<span style="color:blue">if </span>(document.getElementById(control).checked == <span style="color:blue">false</span>) {
slTracks.DeleteAllShapes();
}
<span style="color:blue">else </span>{
Replay();
}
}

<span style="color:green">//Replay
</span><span style="color:blue">function </span>Replay()
{
<span style="color:green">//Build the URL
</span><span style="color:blue">var </span>url=<span style="color:#a31515">"http://YourServer/Replay.ashx?myDate=" </span>+ document.getElementById(<span style="color:#a31515">"ddReplayDate"</span>).value;

<span style="color:green">//Get the appropriate XMLHTTP object for the browser
</span><span style="color:blue">var </span>xmlhttp = GetXmlHttp();

<span style="color:green">//if we have a valid XMLHTTP object
</span><span style="color:blue">if </span>(xmlhttp)
{
xmlhttp.Open(<span style="color:#a31515">"GET"</span>, url, <span style="color:blue">true</span>); <span style="color:green">//varAsynx = true

//set the callback
</span>xmlhttp.onreadystatechange = <span style="color:blue">function</span>()
{
<span style="color:blue">if </span>(xmlhttp.readystate ==4) <span style="color:green">//4 is a success
</span>{
<span style="color:green">//server code creates JavaScript "on the fly"
//execute using eval()
</span><span style="color:blue">var </span>result = xmlhttp.responseText
eval(result);
}
}
xmlhttp.send(<span style="color:blue">null</span>);
}
}

<span style="color:blue">function </span>hideFlyout()
{
System.Gadget.Flyout.show = <span style="color:blue">false</span>;
}</pre><a href="http://11011.net/software/vspaste"></a>
<p>That's it. Now my boss can always see where the "Virtual Hannes" is without even opening his browser.
<p><a href="http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WFXQiwfMLa-V9B009a454mF20Ycoconr8aU2EP_uwtDtq6poU8yTNRqzbr77Z Dzd0vBUww-88NIgkZ4IN8Jdp48?PARTNER=WRITER"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=423 alt=image src="http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WE6LDc73EzSJwOoA94EMfBvVZZDQkFy3jAFbXc oRz66WY0CR6gMttxiUdhow2Pwmyi2pJ5Cvgyve-mhmBH4xibH?PARTNER=WRITER" width=644 border=0></a>
<p>The complete source code for the web application is linked <a href="http://cid-42e1f70205ec8a96.skydrive.live.com/self.aspx/Public/VE-Tracking.zip">here</a>. The code for the gadget is <a href="http://cid-42e1f70205ec8a96.skydrive.live.com/self.aspx/Public/VE-Tracking-Gadget.zip">here</a>:
<p>
<h1>Other Listing</h1>
<h2>GetDates.ashx</h2><pre><span style="background:#ffee62"><%</span><span style="color:blue">@ </span><span style="color:#a31515">WebHandler </span><span style="color:red">Language</span><span style="color:blue">="VB" </span><span style="color:red">Class</span><span style="color:blue">="GetDates" </span><span style="background:#ffee62">%>

</span><span style="color:blue">Imports </span>System
<span style="color:blue">Imports </span>System.Web
<span style="color:blue">Imports </span>System.Data.SqlClient

<span style="color:blue">Public Class </span>GetDates : <span style="color:blue">Implements </span>IHttpHandler

<span style="color:blue">Public Sub </span>ProcessRequest(<span style="color:blue">ByVal </span>context <span style="color:blue">As </span>HttpContext) <span style="color:blue">Implements </span>IHttpHandler.ProcessRequest
<span style="color:green">'set culture to en-UK to avoid potential problems with decimal-separators
</span>System.Threading.Thread.CurrentThread.CurrentCultu re = System.Globalization.CultureInfo.CreateSpecificCul ture(<span style="color:#a31515">"en-UK"</span>)

<span style="color:green">'Retrieve Dates
</span><span style="color:blue">Dim </span>settings <span style="color:blue">As </span>ConnectionStringSettings = ConfigurationManager.ConnectionStrings(<span style="color:#a31515">"Tracking"</span>)
<span style="color:blue">Dim </span>sb <span style="color:blue">As </span>StringBuilder = <span style="color:blue">New </span>StringBuilder
sb.Append(<span style="color:#a31515">"var sOpts = " </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"<SELECT id='ddReplayDate' style='width:190px'>" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">";"</span>)
<span style="color:green">'
</span><span style="color:blue">Dim </span>myDates <span style="color:blue">As String </span>= <span style="color:#a31515">""
</span><span style="color:blue">Dim </span>myConn <span style="color:blue">As New </span>SqlConnection(settings.ConnectionString)
<span style="color:blue">Dim </span>myQuery <span style="color:blue">As String </span>= <span style="color:#a31515">"SELECT DISTINCT GPSdate FROM Tracks ORDER BY GPSdate DESC"
</span><span style="color:blue">Dim </span>myCMD <span style="color:blue">As New </span>SqlCommand(myQuery, myConn)
myConn.Open()
<span style="color:blue">Dim </span>myReader <span style="color:blue">As </span>SqlDataReader = myCMD.ExecuteReader()
<span style="color:blue">While </span>myReader.Read()
myDates = myDates + _
<span style="color:#a31515">"sOpts += " </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"<OPTION VALUE='" </span>+ myReader(0).ToString + <span style="color:#a31515">"'>" </span>+ myReader(0).ToString + <span style="color:#a31515">"</OPTION>\n" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">";"
</span><span style="color:blue">End While
</span>myReader.Close()
myConn.Close()
sb.Append(myDates)
sb.Append(<span style="color:#a31515">"ddReplayDate.outerHTML = sOpts + " </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"</SELECT>" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">";"</span>)
context.Response.Write(sb.ToString())
<span style="color:blue">End Sub

Public ReadOnly Property </span>IsReusable() <span style="color:blue">As Boolean Implements </span>IHttpHandler.IsReusable
<span style="color:blue">Get
Return False
End Get
End Property

End Clas</span>s</pre><a href="http://11011.net/software/vspaste"></a>
<h2>Replay.ashx</h2><pre><span style="background:#ffee62"><%</span><span style="color:blue">@ </span><span style="color:#a31515">WebHandler </span><span style="color:red">Language</span><span style="color:blue">="VB" </span><span style="color:red">Class</span><span style="color:blue">="Replay" </span><span style="background:#ffee62">%>

</span><span style="color:blue">Imports </span>System
<span style="color:blue">Imports </span>System.Web
<span style="color:blue">Imports </span>System.Data.SqlClient

<span style="color:blue">Public Class </span>Replay : <span style="color:blue">Implements </span>IHttpHandler

<span style="color:blue">Public Sub </span>ProcessRequest(<span style="color:blue">ByVal </span>context <span style="color:blue">As </span>HttpContext) <span style="color:blue">Implements </span>IHttpHandler.ProcessRequest
<span style="color:green">'set culture to en-UK to avoid potential problems with decimal-separators
</span>System.Threading.Thread.CurrentThread.CurrentCultu re = System.Globalization.CultureInfo.CreateSpecificCul ture(<span style="color:#a31515">"en-UK"</span>)

<span style="color:green">'Fetch the URL-parameter
</span><span style="color:blue">Dim </span>myDate <span style="color:blue">As String </span>= context.Request.Params(<span style="color:#a31515">"myDate"</span>)

<span style="color:green">'Retrieve GPS-Positions
</span><span style="color:blue">Dim </span>settings <span style="color:blue">As </span>ConnectionStringSettings = ConfigurationManager.ConnectionStrings(<span style="color:#a31515">"Tracking"</span>)
<span style="color:blue">Dim </span>sb <span style="color:blue">As </span>StringBuilder = <span style="color:blue">New </span>StringBuilder
<span style="color:blue">Dim </span>myPins <span style="color:blue">As String </span>= <span style="color:#a31515">""
</span><span style="color:blue">Dim </span>myIcon <span style="color:blue">As String </span>= <span style="color:#a31515">""
</span><span style="color:blue">Dim </span>myConn <span style="color:blue">As New </span>SqlConnection(settings.ConnectionString)
<span style="color:blue">Dim </span>myQuery <span style="color:blue">As String </span>= <span style="color:#a31515">"SELECT Lat, Long, DevName, GPSdate, GPStime, Speed, Heading FROM Tracks WHERE GPSdate LIKE '" </span>+ myDate + <span style="color:#a31515">"' ORDER BY GPStime"
</span><span style="color:blue">Dim </span>myCMD <span style="color:blue">As New </span>SqlCommand(myQuery, myConn)
myConn.Open()
<span style="color:blue">Dim </span>i <span style="color:blue">As Integer </span>= 0
<span style="color:blue">Dim </span>myReader <span style="color:blue">As </span>SqlDataReader = myCMD.ExecuteReader()
<span style="color:blue">While </span>myReader.Read()
i = i + 1
<span style="color:green">'Determine the CustomIcon based on the heading and speed
</span><span style="color:blue">If </span>myReader(5).ToString = <span style="color:#a31515">"0" </span><span style="color:blue">Then
</span>myIcon = <span style="color:#a31515">"stationary.png"
</span><span style="color:blue">Else
Select Case </span>myReader(6)
<span style="color:blue">Case </span>0 <span style="color:blue">To </span>22
myIcon = <span style="color:#a31515">"n.png"
</span><span style="color:blue">Case </span>23 <span style="color:blue">To </span>57
myIcon = <span style="color:#a31515">"ne.png"
</span><span style="color:blue">Case </span>58 <span style="color:blue">To </span>112
myIcon = <span style="color:#a31515">"e.png"
</span><span style="color:blue">Case </span>113 <span style="color:blue">To </span>147
myIcon = <span style="color:#a31515">"se.png"
</span><span style="color:blue">Case </span>148 <span style="color:blue">To </span>202
myIcon = <span style="color:#a31515">"s.png"
</span><span style="color:blue">Case </span>203 <span style="color:blue">To </span>247
myIcon = <span style="color:#a31515">"sw.png"
</span><span style="color:blue">Case </span>248 <span style="color:blue">To </span>292
myIcon = <span style="color:#a31515">"w.png"
</span><span style="color:blue">Case </span>293 <span style="color:blue">To </span>337
myIcon = <span style="color:#a31515">"nw.png"
</span><span style="color:blue">Case </span>338 <span style="color:blue">To </span>360
myIcon = <span style="color:#a31515">"n.png"
</span><span style="color:blue">End Select
End If

</span>myPins = myPins + _
<span style="color:#a31515">"setTimeout('slTracks.DeleteAllShapes();var " </span>+ myReader(2).ToString + <span style="color:#a31515">"=new VEShape(VEShapeType.Pushpin, new VELatLong(" </span>+ myReader(0).ToString + <span style="color:#a31515">", " </span>+ myReader(1).ToString + <span style="color:#a31515">"));" </span>+ _
myReader(2).ToString + <span style="color:#a31515">".SetTitle(" </span>+ <span style="color:#a31515">"""" </span>+ myReader(2).ToString + <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">");" </span>+ _
myReader(2).ToString + <span style="color:#a31515">".SetDescription(" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"Date: " </span>+ myReader(3).ToString + <span style="color:#a31515">"<br>Time: " </span>+ myReader(4).ToString + <span style="color:#a31515">"<br>Speed: " </span>+ myReader(5).ToString + <span style="color:#a31515">"<br>Heading: " </span>+ myReader(6).ToString + <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">");" </span>+ _
myReader(2).ToString + <span style="color:#a31515">".SetPhotoURL(" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"http://YourServer/Hannes.JPG" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">");" </span>+ _
myReader(2).ToString + <span style="color:#a31515">".SetMoreInfoURL(" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"http://johanneskebeck.spaces.live.com/" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">");" </span>+ _
myReader(2).ToString + <span style="color:#a31515">".SetCustomIcon(" </span>+ <span style="color:#a31515">"""" </span>+ myIcon + <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">");" </span>+ _
<span style="color:#a31515">"slTracks.AddShape(" </span>+ myReader(2).ToString + <span style="color:#a31515">");" </span>+ _
<span style="color:#a31515">"map.SetCenter(new VELatLong(" </span>+ myReader(0).ToString + <span style="color:#a31515">", " </span>+ myReader(1).ToString + <span style="color:#a31515">"));'," </span>+ (i * 1000).ToString + <span style="color:#a31515">");"
</span><span style="color:blue">End While
</span>i = i + 1
myPins = myPins + _
<span style="color:#a31515">"setTimeout('alert(" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">"Replay Complete" </span>+ <span style="color:#a31515">"""" </span>+ <span style="color:#a31515">");'," </span>+ (i * 1000).ToString + <span style="color:#a31515">");"
</span>sb.Append(myPins)
myReader.Close()
myConn.Close()
context.Response.Write(sb.ToString())
<span style="color:blue">End Sub

Public ReadOnly Property </span>IsReusable() <span style="color:blue">As Boolean Implements </span>IHttpHandler.IsReusable
<span style="color:blue">Get
Return False
End Get
End Property

End Clas</span>s</pre>
<p>
<div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px">Technorati Tags: <a href="http://technorati.com/tags/Virtual Earth" rel=tag>Virtual Earth</a>,<a href="http://technorati.com/tags/Windows Vista" rel=tag>Windows Vista</a>,<a href="http://technorati.com/tags/Sidebar" rel=tag>Sidebar</a>,<a href="http://technorati.com/tags/Gadget" rel=tag>Gadget</a></div><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=4819404664324524694&page=RSS%3a+Virtual+Earth+as+Gadget+for+Windows+Vi sta+Sidebar&referrer=" width="1px" height="1px" border="0" alt=""><img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&NA=1149&PI=73329&RF=&DI=3919&PS=85545&TP=johanneskebeck.spaces.live.com&GT1=JohannesKebeck">

Click here to view the article. (http://JohannesKebeck.spaces.live.com/Blog/cns!42E1F70205EC8A96!3800.entry)

 
Web mp2kmag.com
mapforums.com