Showing posts with label silverlight. Show all posts
Showing posts with label silverlight. Show all posts

Sunday, 27 December 2009

Moonlight 2.0...

Decided it was time to take another look at Moonlight (since 2.0 was released on 17-Dec-09), so I grabbed a Virtual PC image download and within a few minutes was testing my existing Silverlight sites on Linux! The pre-installed software (Firefox, Moonlight, even MonoDevelop) makes 'getting started' super-easy.

Happily, RaceReplay.net works fine -- although it uses the 'CTP' of Microsoft's Map control - the RTW requires SL3 which might throw a spanner in the works :-(

The DeepEarth open-source DeepZoom-based map control does work, however, which is great.

Searcharoo's Silverlight UI breaks with Could not load type 'BufferedStreamReader' from assembly System.Json so I'll have to investigate that; might have to get a different Json lib.

Anyway, IMO Moonlight 2.0 is a great achievement by Novell and the VPC is a great way for .NET developers to learn about it... have fun!

Sunday, 20 September 2009

Silverlight mapanimation

Taking a small break from MonoTouch to update RaceReplay.net.

Click to view each image


or if you already have Silverlight, watch the animations of today's Sydney Running Festival
Missing MonoTouch?
To get your MonoTouch fix for the day, I recommend the following screencasts by Brent Schooley:Highly recommended.

Wednesday, 12 August 2009

City2Surf 2009 on RaceReplay.net with Flickr

The world's "largest timed footrace" - Sydney's City2Surf - is now viewable on RaceReplay.net thanks to Silverlight and BingMaps.

There are two 'new' features:

1) Flickr photo integration (try it)

Using the Flickr photo search API, the Silverlight client renders small pink-and-blue dots for photos that are both geo-tagged and tagged:"city2surf". Clicking on the dot will open the Flickr page.



2) Visualizing the entire race (try it)

It is (unfortunately) impossible to animate the 65,000 or so points that would represent every runner and walker taking part in the event. By aggregating the finishers into timebands (and using both size & opacity to represent 'value') you can get some idea of the distribution of participants over time, over the course.



Add yourself!

As always, you can search for and add more 'runners' to the animation. Start typing a name into the autocomplete box, select from the list (optionally choose a color from the color-picker) and click Add runner.

Friday, 31 July 2009

Seadragon - Deep Zoom on Demand

Microsoft LiveLabs just announced the release of Seadragon.com, an Azure-based service that creates hosted DeepZoom images 'on demand', making it super-easy to share very-high-resolution images with a quick link.

I tried it out with a few images from my Flickr account (they only take a minute or two to 'process')... click the links to play with Seadragon, click the images just to see a larger copy

Sydney skyline 9774 x 2154 (21 megapixels)



Seattle suburbs from the Space Needle 11991 x 2186 (26 megapixels)



Here's a few more to try for yourself:

Sydney at night 2048 x 768 (1.6 megapixels)

Pike Place Farmers Market 5273 x 2309 (12 megapixels)

Space Needle and Mt Rainier 6388 x 2366 (15 megapixels)

Seattle waterfront from the Space Needle 8861 x 2062 (18 megapixels)

Pike Place close-up 11323 x 3026 (34 megapixels)

As LiveLabs mentions on their website - an easy way to add hi-res images to your eBay listing, real-estate website, ecommerce store, blog, etc...

Saturday, 11 July 2009

SQL in Silverlight

It never ceases to amaze me how short my attention span has become...

what was I saying :) ?

Aaanyway, I sat down in front of my PC today planning to accomplish a few different things... but before that I had to catch up on blogs and twitter. A tweet caught my eye
migueldeicaza IDEA: SOmeone to do a line-by-line port of Sqlite to C# to run inside Silverlight

"Great idea" I thought... but seemed like quite a big job and certainly not something I have the time to tackle. Then I started to recall seeing a C# port of an SQL engine (ages ago) and thought it might be fun to have a poke around. At least it would be easier to port something already in .NET land.

A couple of Google results later, I came across Sharp HSql, a circa 2001 port of the Java-based hsqldb (licence). The code was subsequently added to Codeplex with the following warning: This version is not ready for production grade applications. More testing is needed and some important bugs has to be fixed before that. You are warned.
Long story short...
it's a couple of hours later and I've done nothing that I'd planned to, but here is an 'alpha' of SharpHSql for Silverlight (try it out) - there's some test SQL at the bottom of the post.


The "port" mainly consisted of:
  • 'implementing' ArrayList and Hashtable (umm, can you say List<object> and Dictionary<object, object>)
  • removing the 'Provider' and all the dependencies on System.Data that work fine in the full framework, but are missing from Silverlight (would be nice to add some sort of wrapper back in...)
  • converting FileInfo and related operations to IsolatedStorageFileStream (still some persistence testing to do...)
  • breaking DateTime handling (for now)
The REAL work was all done by Mark Tutt so don't get the idea that I'm taking any credit - all the goodness is his, any errors are mine.

The full source of the consuming Silverlight app is this Page.xaml and Page.xaml.cs; the full Visual Studio 2008 project ZIP (199Kb) is available to download. Anywhere I've touched the code you'll find a //HACK: tag!

Disclaimer: I've no idea if this is fit for any purpose at all... it seems to be able to DROP and CREATE tables, INSERT rows and SELECT/JOIN - but even that could be a fluke. Try it out at your own risk; leave a comment if you find something good or bad. Have fun!

UPDATE: the output is a lot prettier (try it) with the Silverlight DataGrid and Vladimir Bodurov's awesome dynamic datasource compiler - updated for generic types

(updated source (277Kb))

Test SQL

#1
DROP TABLE IF EXIST "books";CREATE TABLE "books" ("id" INT NOT NULL PRIMARY KEY, "name" char, "author" char, "qty" int, "value" numeric);

INSERT INTO "books" VALUES (1, 'Book000', 'Amy', 1, 23.5);
INSERT INTO "books" VALUES (2, 'Book001', 'Andy', 2, 43.9);
INSERT INTO "books" VALUES (3, 'Book002', 'Andy', 3, 37.25);
INSERT INTO "books" VALUES (4, 'Book 21', 'Amy', 99, 20.5);
INSERT INTO "books" VALUES (5, 'Book 22', 'Andy', 2, 903.9);
INSERT INTO "books" VALUES (6, 'Book 23', 'Andy', 5, 0.25);

SELECT * FROM "books" ORDER BY "value"

DROP TABLE IF EXIST "author";CREATE TABLE "author" ("name" char NOT NULL PRIMARY KEY, "country" char);

INSERT INTO "Author" VALUES ('Andy', 'UK');
INSERT INTO "Author" VALUES ('Amy', 'USA');

SELECT * FROM "author" ORDER BY "value"

SELECT * FROM "books" LEFT JOIN "author" ON "author"."name" = "books"."name"
#2
CREATE TABLE "clients" ("id" int NOT NULL IDENTITY PRIMARY KEY, "DoubleValue" double, "nombre" char, "photo" varbinary, "created" date );
INSERT INTO "clients" ("DoubleValue", "nombre", "photo", "created") VALUES (1.1, 'NOMBRE')
SELECT * FROM "clients"

Tuesday, 12 May 2009

Draw on Silverlight Virtual Earth Map Control

There are a couple of different projects where I'd like to enable 'drawing' on a map (including RaceReplay.net) - this is a basic first-cut of drawing within the Microsoft VE Map Control.

Each click on the map will start/continue a line. The MouseLeave event is wired to start a 'new' line. Navigating the map (dragging/double-click zoom) also causes points to be drawn - obviously this needs some work...


The two files required to build it are Page.xaml and Page.xaml.cs, the key pieces of code being
private void VEMap_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Map m = (Map)sender;
Location l = m.ViewportPointToLocation(e.GetPosition(m));
if (polyline == null)
CreateNewPolyline(l);
else
polyline.Locations.Add(l);
}
and
private void CreateNewPolyline(Location startPoint)
{
polyline = new MapPolyline();
polyline.Stroke = new SolidColorBrush(Colors.Red);
polyline.StrokeThickness = 2;
var lc = new LocationCollection();
lc.Add(startPoint);
polyline.Locations = lc;
VEMap.Children.Add(polyline);
}
Simple, eh?

p.s. these are plain old straight lines - at the 'continent' level you might expect them to curve as though on a great-circle; I'm not too worried about implementing that right now since the target usage of my drawing is at a much "smaller scale"... however Geoquery2008 does draw great circle lines correctly...

Saturday, 9 May 2009

Silverlight DataContractJsonSerializer Error

Admittedly there is very little excuse for hand-crafting Json output these days, with libraries like Json.NET available, and WCF supporting Json natively. However, I was tweaking an existing ASPX page (that was actually rendering Xaml for a Silverlight 1.0 application) to turn it into a 'service' for Silverlight 2.0... and it seemed like the fastest way to do that was simply replace a whole pile of <s and >s with {}

I got some hints/reminders on how to Consume a JSON object in Silverlight, and found Jsonlint really helpful in tuning the output until it was valid Json.


Then I created a 'matching' object model in Silverlight C#


and wired up the OpenReadCompleted event using DataContractJsonSerializer


Everything LOOKED like it should work, so at first I was confused by this error message:
Unable to cast object of type 'System.Collections.Generic.List`1[System.Object]' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'

After staring blankly at the code for a while, I finally realised where my Json had gone wrong -- at the very root of my Json response (see Jsonlint image above) I was "accidentally" wrapping the entire Json output with an unnecessary [] pair. I guess this meant the Deserializer was expecting to cast into a collection (albeit with a single element), but I was intending the root Json element to be a single object (to match my C# JsonCourse).

The simple fix was removing the enclosing [] so that my Json started off like this instead:
{
"width": 800 ,
"height": 600 ,
"runners": [
{
"name": "mapcanberramarathon",
"points": [
Lesson for tonight is to better understand the underlying Json representation before consuming it (or else use a library rather than hand-craft the output). Anyway now it is fixed RaceReplay.net 2.0 is that much closer to fruition...

Saturday, 2 May 2009

Silverlight "Maps That Bend Upwards"

I was inspired today by HERE & THERE's horizonless projection of Manhattan (via The Map Room: Maps that Bend Upwards).

Using Silverlight 3.0 beta and it's new PlaneProjection feature, I have hooked up three Silverlight Map Controls with different values for RotationX, GlobalOffsetY (vertical displacement) and GlobalOffsetZ (in/out of the page) to create a very crude 'interactive' version of their horizonless-map.

If you have Silverlight 3.0 beta installed, you can try out the Silverlight Virtual Earth Maps That Bend Upwards OR if you don't have the beta installed, you can watch a screencast.


[try it] [watch it]

I've noticed a little bit of weird behaviour on loading (sometimes the 'initial' map of New York doesn't load completely sync'd in all three panels), but after that it seems to work OK - it's just for fun after all.

Friday, 17 April 2009

Silverlight 3.0 PlaneProjection (with DeepZoom)

I previously built a rather gratuitous PlaneProjection demo flipping around a Silverlight Map Control. A slightly more useful (or at least interesting) use of Silverlight 3.0 PlaneProjection is this Deep Zoom 'tile pyramid visualizer'...


[fullsize image] [try it out]

Rather than just play around with the RotationX and RotationY properties,
  • GlobalOffsetZ is used to 'push back' the larger images to sit 'behind' the smaller, foremost image
  • CenterOfRotation is set to GlobalOffsetZ * -1 so that all the images rotate around the same point
  • RotationY is then used to rotate them all together

Here are some diagrams to explain what that all means:

Firstly, each 'layer' in a Deep Zoom image is double the the size of the previous one (height/width) so when they three layers are rendered on top of each other, you can clearly see the size differences:


However when we apply the PlaneProjection to move the larger images along the Z axis (ie. in/out of the page) we can create the effect that all three images are the 'same size'.

Altering the PlaneProjection attributes listed about let's us zoom and rotate the pyramid to get a totally useless but kinda cool looking view of a Deep Zoom tile pyramid...

UPDATE: For those without Silverlight 3.0 installed, I've recorded (my first!) screencast demo (sorry it's in Flash - something to figure out another time...)

Tuesday, 7 April 2009

Polyline.StrokeLineJoin and tight corners

Sharp corners in Polylines (particularly thick ones) can create unintended artefacts - particularly apparent when converting a (somewhat shaky) GPS track into a line on the Silverlight VE Map Control.

In this screenshot the circled 'line extension' (leading off into the water) is not actually part of the path, but an artefact of a very tight corner:


A few simple additions - StrokeLineJoin being the most important - and the Path looks "correct":

<m:MapPolyline
Stroke="Blue" StrokeThickness="10" x:Name="Course"
StrokeLineJoin="Round"
StrokeEndLineCap="Round"
StrokeStartLineCap="Round"

Locations="-33.84780366140732,151.21159315109253 -33.84504135759562,151.2111210823059 -33.84418591636912,151.2106704711914 -33.84374037067171,151.21082067489624...
/>




Just something to be aware of...

Monday, 6 April 2009

Silverlight VirtualEarth Map Control - with video

Okay - I wasn't going to do any more Silverlight VE Map Control posts... this is definitely the last one! I found some videos on YouTube that I thought suited 'animating' a map so I gave it a try. These would work MUCH BETTER if I had Silverlight-encoded videos that I could sync to/control more easily: but you get the idea...

Sydney City2Surf


Sydney Marathon


p.s. YES I know it's dodgy to have to 'sync' the start of each element manually - but without lots of hassle figuring out if the YouTube video is loaded and running it was the easiest way to proof-of-concept...

Wednesday, 1 April 2009

Silverlight VirtualEarth Map Control - with animation MkII

In recent posts I was working to get the new Virtual Earth Silverlight Map Control (CTP) to:
  1. display (pan/zoom) an <Image> overlay

  2. display (pan/zoom) a <Path> line

  3. animate a set of <Ellipse>s that also (pan/zoom)

  4. animate the map center point to 'track' an <Ellipse>

Turns out this was all possible - there are two examples: New York Marathon and Sydney Half Marathon

Each problem was overcome as follows:

1. Use m:MapLayer.MapRectangle not Height/Width

Any "pixel-specific" measurements applied to the Image will intefere with your Map layout. DO NOT specify Height, Width, Canvas.Left, Canvas.Top - just give the NW and SE corners (latitude,longitude) of the geographic region the image should cover, like this:
<Image Source="map.png" m:MapLayer.MapRectangle="40.8325608405556,-74.1015908473376,40.5722860972124,-73.843755459154"...

2. Use m:MapPolyline not Path

Although it was possible to keep the Path inside a Canvas element and place it with MapRectangle, it did not scale well since the Path Data is effectively tied to pixel coordinates. It is possible to write code to manually scale the line, but it was much easier to re-express the line with points specified by Latitude,Longitude in a m:MapPolyline like this:
<m:MapPolyline Stroke="Red" Locations="-33.863502543277534,151.20294570922852...

3. Use m:MapLayer.Position and a custom attached property

Positioning the Ellipses was easy using m:MapLayer.MapPosition, however animating this property was a little tricky. MapPosition is of Type Location but the Latitude and Longitude properties are not easily accessible as the TargetProperty of an animation, so I needed to write custom attached properties and set them as the target in code.
<Ellipse Fill="#FFFF0000" Width="11" Height="11" m:MapLayer.MapPosition="-33.863502543277534,151.20294570922852" m:MapLayer.MapPositionMethod="Center"...

4. Use m:Map.Center and a custom (hacked) attached property

Making the Map 'viewport' itself animate proved slightly trickier again. I created another attached property (code for all properties here) for some reason only one 'axis' (Longitude) would animate.

When I removed the Longitude property, then the Latitude position would animate... but I could not get them both animating together. Figuring it was a timing issue, rather than try to "set" both properties when they Changed, Latitude gets stuffed into a static field and then set in the LongitudeChanged handler - seems to work but not sure if it's a good idea (obviously it would break if you tried to animate two maps at the same time!)

More info on the final example - no more Map Control posts for a while...

Friday, 27 March 2009

Silverlight VirtualEarth Map Control - with animation

UPDATE: The Microsoft devs were right - it is possible (and not a bug). The 'complete' sample now keeps the image, course line and animated objects visible during all panning and zooming operations - try out
animation with Silverlight Virtual Earth Map Control!

I've made some progress with my first Silverlight Virtual Earth Map Control project...

Try it out (deprecated) latest

Here are some screenshots of the zoom/animation in action:



The code and xaml also online - I needed to (well, I think I needed to) use the ViewChangeEnd event to re-calculate various offsets and dimensions to keep the animation and overlay image sychronised with the Map Controls' zoom behaviour (even though panning worked without modification).

Monday, 23 March 2009

MIX 10k entry goes OutOfBrowser

I have updated my MIX 10k Challenge entry to Silverlight 3.0 so itcan run out-of-browser!

You can visit the Silverlight 3.0 version of exploDZ, and install it locally for yourself WARNING: will prompt to install Silverlight 3.0 which is in BETA

1. Right-click and choose to Install


2. Select "where" to install (this is really only where the shortcuts go)


3. Silverlight 3.0 having an out-of-browser experience


This is really only a test of Silverlight 3.0 - exploDZ was just a bit of fun, and there is already an ClickOnce/WPF version at DeepZoomPublisher.com/Viewer.

Code changes

Thanks to Chris' Silverlight 3.0 out-of-browser instructions the ONLY change from the 2.0 to the 3.0 (out-of-browser) version was the following element added to the AppManifest.xml file:

<Deployment.ApplicationIdentity>
<ApplicationIdentity
ShortName="exploDZ"
Title="Out of browser DeepZoom Viewer">
<ApplicationIdentity.Blurb>
exploDZ out-of-browser (Silverlight 3.0)
</ApplicationIdentity.Blurb>
</ApplicationIdentity>
</Deployment.ApplicationIdentity>


What it does

The shortcut created by the 'installer' has a target like this:
"C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe" conceptdevelopment.net.0
I guess that parameter reflects the 'source site' and index of Silverlight OutOfBrowser apps -stored in a safe place somewhere :) stored in Apps\LocalLow\Microsoft\Silverlight\Offline\ (on Windows 7 at least).


The index.html ISN'T the hosting page from the internet - it's a custom Silverlight object tag:


The metadata file contains
LaunchPath=C:\Users\Craig\AppData\LocalLow\Microsoft\Silverlight\Offline\conceptdevelopment.net.0\index.html
SourceDomain=conceptdevelopment.net
OriginalUri=http://conceptdevelopment.net/silverlight3/outofbrowser01/exploDZ.zip
AppID=conceptdevelopment.net.0
Description=exploDZ out-of-browser (Silverlight 3.0)
Title=Out of browser DeepZoom Viewer
Name=exploDZ


How it works?

Who knows??? Tim's Silverlight 3 Out-of-browser Update Model overview is a worthwhile read.

Adobe's AIR out-of-browser host for Html-Javascript and Flash/Flex sits atop WebKit, and from the index.html above it seems likely that OutOfBrowser-Silverlight is also sitting in a little web browser of some description. It's only 500Kb, so it's not IE :) - and there also has to be a Mac version... it doesn't appear to be managed code (or I'd guess Cassini), maybe the Mac one is related to Chiron? Speaking of Mac - this is how it looks in Safari 4 beta...


Sunday, 22 March 2009

Silverlight VirtualEarth Map Control - with DeepZoom Images

"TagUpdater" parses through your Deep Zoom metadata.xml, opens the images and reads EXIF title/description/tag data... so it was pretty simple to extend it to read latitude & longitude.

The location of each Deep Zoom sub-image is then available to display on a map, in the Tag Browser sample:


1. Metadata.xml entries now look like this
<Image>
<FileName>C:\Dev\Cities\bhutan_tigersnest.jpg</FileName>
<x>0</x>
<y>0.127264287334191</y>
<Width>0.199250151375691</Width>
<Height>0.203911475380207</Height>
<ZOrder>11</ZOrder>
<Tag>bhutan</Tag>
<Description>Amazing monastery perched on a cliff in Bhutan near Paro</Description>
<Rating>0</Rating>
<Title>Tiger's Nest</Title>
<LatLong>27.4266666666667,89.4033333333333</LatLong>
</Image>


2. We add a Silverlight VirtualEarth Map Control
xmlns:m="clr-namespace:Microsoft.VirtualEarth.MapControl;assembly=Microsoft.VirtualEarth.MapControl"
<m:Map x:Name="viewMap" Grid.Row="3" Height="220" Opacity="0.25" />


3. and in the code add a new MapLayer
MapLayer PinMapLayer = new MapLayer(); // Layer on map to 'add' stuff to [MAP]

viewMap.AddChild(PinMapLayer);


4. Then display the pins within the xmlClient_DownloadStringCompleted method (originally from Kirupa's sample)
//Now add to map [MAP]
if (latlongString != "")
{
var l = new Location(
Convert.ToDouble(latlongString.Split(',')[0])
, Convert.ToDouble(latlongString.Split(',')[1])
);
Image pin = new Image();
pin.Source = new BitmapImage(new Uri("blue_pushpin.png", UriKind.RelativeOrAbsolute));
pin.Stretch = Stretch.None;
var tooltipObject = new StackPanel();
var title = new TextBlock();
title.FontWeight = FontWeights.Bold;
title.Text = titleString;

tooltipObject.Children.Add(title);
var description = new TextBlock();
description.Text = descriptionString;
tooltipObject.Children.Add(description);

ToolTipService.SetToolTip(pin, tooltipObject);
// Adds the pushpin to the map layer.
PinMapLayer.AddChild(pin, l, PositionMethod.BottomCenter);
}


5. and in msi.MouseMove, move the map for the 'current' image
l = new Location(
Convert.ToDouble(imageMetadata[subImageIndex].LatLong.Split(',')[0])
, Convert.ToDouble(imageMetadata[subImageIndex].LatLong.Split(',')[1])
);
viewMap.Opacity = 1;
viewMap.SetView(l, 12);


If you play with it it will be obvious there are some useability issues with changing the map 'on hover' over the images (it's difficult to get the mouse over to the map if you want to navigate around), but the Silverlight VirtualEarth Map Control definitely makes it easy to build!

Saturday, 21 March 2009

Silverlight VirtualEarth Map Control - Search Results

Try out a basic search results view using the Silverlight VirtualEarth Map Control at searcharoo.net/SilverlightMap.html...

Searcharoo with Silverlight Map Control


Thanks to Chris Pietschmann's Tooltip example each pin shows what search result it refers too (although I still haven't figured out to make the pins 'click-able' to open the result link directly...).

The relevant code added to the search result JSON parsing:

1. Create a MapLayer
MapLayer PinMapLayer = new MapLayer();

2. Add it to the Map control first (ie. before adding Children)
ResultMap.AddChild(PinMapLayer);

3. Extract GPS location
var l = new Location(
Convert.ToDouble(result.gps.Split(',')[1])
, Convert.ToDouble(result.gps.Split(',')[0])
);


4. Create the pin (Image), add tooltip and add to MapLayer
Image pin = new Image();
pin.Source = new BitmapImage(new Uri("blue_pushpin.png", UriKind.RelativeOrAbsolute));
pin.Stretch = Stretch.None;

var tooltipObject = new StackPanel();
var title = new TextBlock();
title.FontWeight = FontWeights.Bold;
title.Text = result.name;
tooltipObject.Children.Add(title);
var description = new TextBlock();
description.Text = result.description;
tooltipObject.Children.Add(description);
ToolTipService.SetToolTip(pin, tooltipObject);

// Adds the pushpin to the map layer.
PinMapLayer.AddChild(pin, l, PositionMethod.BottomCenter);



The search box is pre-populated with manhattan which results in a set of photos.



Perform that search, then search for sydney to see how the VirtualEarth Silverlight Map Control animates between the two locations with nothing more than a simple call to SetView

ResultMap.SetView(GetMinMaxCenter(min, max), 12);

The complete code will be available on Searcharoo@Codeplex shortly.

p.s. another search to try is - pumpkin - geocoded photos are so cool!

Silverlight VirtualEarth Map Control - in "3D"

Further to my previous post on the Silverlight VirtualEarth Map Control - here it is in Silverlight 3.0 WARNING: will prompt to install Silverlight 3.0 - which is in BETA - do so at your own risk!


The animation and map styles (road|arial) work as you'd expect, but somehow it looks a lot cooler with this little bit of code added :-)

<Canvas.Projection>
<PlaneProjection RotationX="-60" />
</Canvas.Projection>


BTW, it seems to me like addition of 3D Projection (rather than a complete 3D environment, ala Kit3D and WPF) is the minimum they needed to add to get Photosynth working "natively" in Silverlight (instead of the current Silverlight-Photosynth beta which does use Kit3D)? ... hmmm ...

Friday, 20 March 2009

Silverlight VirtualEarth Map Control - initial impressions

Microsoft was bound to deprecate all the work on silverlightearth.com (and others on DeepEarth) at some point :D - and they've finally released a CTP of their efforts.

The control can be downloaded from Microsoft Connect: Silverlight Map Control - you have to register and fill in a survey first but then you're good to go. There is also a Getting Started guide to help, you know, get started.

It's actually pretty simple:
  • Add Reference to Microsoft.VirtualEarth.MapControl

  • Add namespace xmlns:m="clr-namespace:Microsoft.VirtualEarth.MapControl;assembly=Microsoft.VirtualEarth.MapControl"

  • and Xaml <m:Map x:Name="viewMap"/>

  • sprinkle a bit of C# (unnecessary, but why not)
    viewMap.View = new Microsoft.VirtualEarth.MapControl.MapViewSpecification(new Location(40.7199, -74.0030), 12.0000); //New York

and you've got a map!


Details

The control doesn't like being hosted on the filesystem (good old WebClient and ClientAccessPolicy restrictions I suppose) so when creating your first test project, remember to hook up a WebApplication as well...



otherwise you'll get the same error as the design surface does
Map loaded in unsupported URI scheme. Please reload page in http scheme.

but a WebApplication with an automatically created TestPage works just fine



Naturally I then wanted to apply it to something useful, so you can give this New York Marathon (2006) visualizer a go... in case it isn't obvious, it's showing how far behind the winner I was (and how far behind me Lance was :)
New York Marathon with Microsoft Virtual Earth Silverlight Control
I've blocked panning/zooming on it for now (until I figure out how to keep the animations and course in sync), but that is a bona-fide Microsoft Virtual Earth Silverlight Control (CTP) in there!
UPDATE [22-Mar]: I've updated the example so that dragging/panning works BUT zooming is still broken. I think I've copied the iSDK Add scalable element example exactly (but their Rectangle scales and my content doesn't). Weird...

The change was to move the 'animation canvas' inside the Map, like this:
<m:Map.Children>
<m:MapLayer>
<Canvas
m:MapLayer.MapRectangle="40.8325608405556,-74.1015908473376,40.5722860972124,-73.843755459154"
m:MapLayer.MapPositionMethod="Rectangle"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">


That didn't take long at all - so initial impressions are good. The map controls are very smooth and the basic stuff is intuitive to program around. In addition to the links above, you will want to play with the Interactive SDK and keep the SDK CHM handy until sample code starts appearing in the wild...

I wonder what the release date and go-live licensing details are???