Encontrei este post do Nick Randolph, mais uma da familia Live.
Do you want to integrate Virtual Earth into your website but are daunted by the prospect of using the javascript object? Well as part of the Windows Live Tools for Visual Studio there is an ASP.NET Virtual Earth control that you can drag onto your aspx page, set properties add event handlers, all without writing a line of javascript.
To get started you will of course need to download and install the Windows Live Tools for Visual Studio. The November CTP is currently available for download.
Once you have installed the tools you will notice that there are some additional toolbox items in a tab entitled Virtual Earth:

Select the Map and drag it onto your aspx page. Note that you will also need a ScriptManager control as the Virtual Earth ASP.NET control uses this to communicate with the server so that you can wire up events.

As you can see you can set properties on this control such as the Zoom level, whether Traffic information is displayed and even whether the scale is in Miles or Kms. What’s even better about this control is if you select the Event tab in the properties window you will see that there is a list of server side events that you can wire up.

Here you can see I’ve added an event handler for the ServerClick event. The Server prefix is there to indicate that the event is raised server side. Here is some code that adds a polygon shape to the map when the map is clicked.
using System.Collections.Generic;
using Microsoft.Live.ServerControls.VE;
namespace VESampleApp
{
public partial class _Default : System.Web.UI.Page
{
protected void Map1_ServerClick(object sender,
MapEventArgs e)
{
Shape s = new Shape(ShapeType.Polygon, new List<LatLongWithAltitude>(){
new LatLongWithAltitude(20,20),
new LatLongWithAltitude(20,25),
new LatLongWithAltitude(25,25),
new LatLongWithAltitude(25,20)
});
s.HideIcon();
this.Map1.AddShape(s);
}
}
}
Reference: http://www.professionalvisualstudio.com/blog/2008/11/26/virtual-earth-aspnet-control/
Comentários