Virtual Earth has a great api, better than Google Maps IMHO, but JavaScript is PITA if you have no editor support. VS2008 has brought Intellisense to many JavaScript scenarios, but not to VE development - up until now that is.
A Code Plex project (that I had the pleasure to be involved in, though in a tiny tiny way, because the project was completed so quickly! - I expect to be more involved in future iterations) has made it easy to have JavaScript Intellisense for VE in Visual Studio.
The Virtual Earth: An Evangelist's Blog has a good write up but here's a screen shot to wet your appetite, and some step by step installation instructions to get you started:
Using the Example Solution
To get started and use the provided solution:
- Download the VE JavaScript Intellisense Helper zip file
- Unzip the files and you will get a folder with a VS2008 solution. You can open this solution up directly in VS 2008 and start writing JavaScript in Default.aspx.js straight away - you will get the Intellisense automatically.
Including VE JavaScript Intellisense in an Existing Solution
To included the JavaScript Intellisense in an existing project:
- Copy the VEJS folder into the web site
- Create a JS file (a common naming convention is to use the AspxPageName.aspx.js though you can use whatever you want) and add a reference to the VE JavaScript Helper using the following syntax:
/// <reference path="VEJS/VeJavaScriptIntellisenseHelper.js" />
- In the page you want to use Virtual Earth on add a JavaScript reference to the VE control and to the JavaScript file you created in step 2. You can either use the ScriptManager (if you are using Asp.Net 3) or normal script tags:
<script type="text/javascript" src="Default.aspx.js"></script>
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script>
Or:
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference
Path="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6" />
<asp:ScriptReference
Path="Default.aspx.js" />
</Scripts>
</asp:ScriptManager>
Cheers
Ian