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
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
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 :)
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
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???
Cool, can you hook up another datasource like a WMS?
ReplyDeleteCheck out the interactive SDK to get an idea of the API... I'm sure the various WMS providers could easily leverage the control to extend their existing services.
ReplyDeleteThis tutorial on adding custom map imagery and this one on using other tile layers (like OpenStreetMap) prove that it is extensible...
Hi Craig,
ReplyDeleteFirstly great work on the race stuff. I have been working on some simular stuff that works with GPS Devices and you have got me out of a couple of head scratching moments!
Have you tryed to migrate this stuff to the new Bing Maps release?
The animations seen to freeze after teh first few seconds unless you manually move the map during the animation.
Any Ideas?
Mike
Hi Mike,
ReplyDeleteI'm having the same problem - should never have upgraded!! Did you find a solution by any chance?
Thanks,
John
Hi sir,
DeleteYou got any solution:
"I did the changes under out-of-browser application and it is working fine i.e project is not opening under any browser, but now i want that project to be shown under browser.
I reverted the changes, but now it is showing an error(i.e map is now visible(rest project is visisble)...and the error it is showing is "map loaded in unsupported uri scheme, please reload page in http scheme"."
plz help and mail me at my id
Hi Craig,
ReplyDeletedo you think it's possible to develope a similiar project using the WPF Bing Maps Control(Beta)?
Thanks,
Moritz