Ahoy! – Silverlight Virtual Earth MapControl

johnny depp pirates of the caribbeanWhat does a developer do when exploring the possibilities of the new Silverlight MapControl.  Create a pirate map of course!

australia

Yarr!  So how do you get the paper look and feel on the map?  It’s a simple, and doesn’t require any C#, you can do it purely via the XAML.

<grid x:name="LayoutRoot" background="#FF000000">
      <img x:name="Paper" source="images/ye_atlas.jpg" />
      <m:map x:name="MainMap" opacity="0.5" />
</grid>

Yes, that’s how easy it is.  The aged paper look doesn’t zoom, I played around with having the paper scroll and zoom with the map, and it gave me a headache.  One of those times when you spend an hour or so finding that your cool idea wasn’t as cool as you thought.  When you zoom in, what does it look like?

sydney_close

But what is missing from the map?  Treasure of course!  YARRR!  Pushpin marks the spot!  So add a few custom pushpins, a bezier path later, and the map shows you the way.  How do you add a pushpin?  The best way is to create a layer to put all your pushpins, that way you can hide/show them all together quite easily.  So your XAML becomes…

<Grid x:Name="LayoutRoot" Background="#FF000000">
    <Image x:Name="Paper" Source="images/ye_atlas.jpg" />
    <m:Map x:Name="MainMap" Opacity="0.5" >
        <m:Map.Children>
        <m:MapLayer x:Name="PushpinLayer"/>
        </m:Map.Children>
    </m:Map>
</Grid>

… and by adding the following function which takes the position, the pixel size to resize your image/pushpin icon, and the title text of the pushpin …

private void AddPushpin(double latitude, double longitude, double size, string title)
{
    // Grab our map layer
    MapLayer ml = MainMap.FindName("PushpinLayer") as MapLayer;

    // Create the title for the pushpin
    TextBlock t = new TextBlock();
    t.Text = title;
    t.SetValue(MapLayer.MapPositionProperty,
                    new Location(latitude, longitude));
    t.SetValue(MapLayer.MapPositionMethodProperty,
                    PositionMethod.Center);

    // ... and the Pushpin image
    Image img = new Image();
    img.Width = size;
    img.Height = size;
    img.Source = new BitmapImage(new Uri("images/skull.png",
                                                UriKind.Relative));
    img.SetValue(MapLayer.MapPositionProperty,
                        new Location(latitude, longitude));
    img.SetValue(MapLayer.MapPositionMethodProperty,
                        PositionMethod.TopCenter);
    ml.AddChild(img);
    ml.AddChild(t);
}

Note the use of the PositionMethod to have the bottom of the title aligned with the top center of the image.  Having this makes life so easy when plotting pushpins on a map around a particular coordinate.

Call AddPushpin in your public Page() constructor, and play around with adding pushpins.  Lots of fun to play around with.  Then by simply adding a bezier path method (which I’m still not happy with yet) and vary the pushpins and voila, there be treasure! YARR!

new_yaark_treasure

If only the sailors of yesteryear had zoomable pannable treasure maps!  Features to come are some pirate ships that float around in the water… and I’d love to add a little mini-canon fight, but time is of the essence.

So why is this exciting?  Well, aside from our privateering friends out there, what it does open up is a great way to communicate hiking trails, cycling tracks, walks.  Feed in a heap of map data and you can overlay anything!  Add a custom map data source and you can really start to expand the possibilities.

Read More

Game Review – Street Fighter IV

streetfighter42 

Street Fighter IV arrived on my coffee table last month.  I can’t stop playing it.  There are too many reasons why.  Being addicted to Street Fighter II when it came out, I had been waiting a long time for the game to evolve significantly.  Everything post Street Fighter II until now has felt like an experiment in what to do next, and with Street Fighter IV being released, it has finally stepped up.

3D is a big aspect graphically in the game, but fighting is still 2D.  Ultra moves/combos when in action allow for some camera play, as it zips around giving a truly dramatic feel.  In game music is excellent, and the sound FX are top notch.  I would however pay for someone to mute the announcer, and the boy band that plays during the title screen.

Where SF4 really shines is in online multiplayer.  Create a lobby, wait a minute, bam, you’re online kicking but with your leet skillz.  The best online feature is being able to play arcade mode, and still having a lobby available online for people to join, meaning that during quiet times online you can dive straight into the game practise pulling off your 94 move combo.

The new characters are excellent, with 25 characters available (16 available initially, and 9 unlockable characters), and each character feeling just right.  The stories in arcade mode are fun to watch, and the challenge modes provide some extreme combo challenges.  Titles and Icons are a great way to earn some street cred, whilst giving the game more legs.

And then when you think you’re starting to get the new game, you discover focus moves.  Focus moves are the first step in the master part of ‘easy to pick up, hard to master’.  But when you start learning how to use them, watch your online ranking halve overnight.  Moves that were hard to deal with will become trivial, and block turtles now have more to worry about than fireballs and throws.

A game that may not appeal to those who aren’t Street Fighter fans, it’s a must buy for those that were or still are, and it will have you playing online for many months, if not years.

And yes, playing it on a big HD plasma between the two Street Fighter Rubixels is awesome.

Big thumbs up.  5/5.

ninjaninjaninjaninjaninja

Read More

Movie Review – Man on Wire

But the one movie I did see on the flight, was Man on Wire.  The story of Philippe Petit, and his amazing stunt back in 1974, doing a wire walk between the towers of the World Trade Centre.  Delivered in a similar fashion to Touching the Void, you can’t help but be captured by the story.

man_on_wire

Without spoiling the movie, it also covers his other exploits (including Sydney Harbour Bridge pictured above), and is an exciting insight into the eccentric man himself.  You don’t need to see it tomorrow, but it’s definitely a must see.

ninja ninja ninja ninja ninja

Read More

Movie Review Bonanza – Elegy, Death Race, Ghost Town, Rachel Getting Married

I’ve seen a lot of movies over the last week with the flights to Vegas, so I’m throwing them all into a single post.  Being in Vegas, I’ve also become quite fond of the word ‘bonanza’.

Rachel Getting Married – Chick in rehab.  Sister getting married.  Drama.  Cry cry.  The end.   

ninjaninjaninja

 

Elegy – Guy meets girl.  Drama.  Sick sick. The end.

ninjaninjaninjaninja

 

Death Race – Get out of prison if you race.  Zoom Zoom. The end.

ninjaninja

 

Ghost Town – Guy dies.  Guy sees ghosts.  Life change.  The end.

ninjaninjaninja

Read More

MIX09 Day 3 – Silverlight, Virtual Earth, and Pigmaps

Day 3 of MIX09. I head to a few sessions, all of which are interesting.Don't Shag the Pinball Machine

Virtual Earth integration from Silverlight was the highlight. Once again a nice clean API allows developers to pick it up, with fully integrated customised maps in Silverlight developed faster than previously possible. Video and media asset integration, scaling/zooming/”deep zoomesque” capabilities, and the ability to feed in your own map data.

So how easy is it?  Well, first up you need the control DLL.  And once you’ve done that, you’ll need the following XAML…

<UserControl x:Class="MapControlInteractiveSdk.Tutorials.Tutorial1"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:m="clr-namespace:Microsoft.VirtualEarth.MapControl;
                assembly=Microsoft.VirtualEarth.MapControl"
>
   <Grid x:Name="LayoutRoot" Background="White">
     <m:Map />
   </Grid>
</UserControl>

BAM!  Map with controls in Silverlight in 3 seconds.  Even more impressive is all the small tweaks you can do in only a few lines of code.  Chris Pendleton has a wrap up and other posts over at the Virtual Earth Evangelist’s Blog, so check out further details.

Another session I found interesting was Pigmap. All I could ascertain is that the translated meaning behind the brand could probably translate to ‘cash cow’, and although the presentation had a lot to be desired, the Korean markets tend to push online community concepts many years before the western world picks them up.

Pigmap will be a social networking site.  It leverages Virtual Earth, flickr, and other services (OpenID, Live ID etc). To provide users with mapping, it searches Virtual Earth for certain locations and venues. So search for Las Vegas NV, and BAM, Las Vegas turns up on the map. But then type in ‘Venetian’ as a point of interest, and the platform searches Flickr for photos matching Venetian, grabs their geo coordinates, and drops thumbnails on the map (“The End of Theory” theory strikes again).

The questionable feature of the site is the ability to set “Missions” for people using the product. To be able to go “Dear X, I challenge you to go to this location” doesn’t really appeal to me, but “Dear X, you want to head here tonight?” might work, but many other services provide that functionality. Possibly Korea is too far ahead culturally with social networking that it zips over my head.

And that’s a wrap from MIX09. There is just so much more to talk about, and many of that will come with some of the posts that grow out of playing with the new toys. Head on over to the downloads page to grab your favourite preview/beta/CTP/SDK… and remember to check out the sessions at sessions.visitmix.com.

MIX oh-ten has been announced, and I’m excited to see where the designer and developer community has taken these tools by then. 

Catch you online when I land back in Australia. 

Don't Shag the Pinball Machine

Read More