Recent Blog Posts RSS
ViaWindowsLive on Via Virtual Earth Blog
The new ViaWindowsLive community site has launched and features not only a definitive set of resources on all Live Services from Microsoft but also a special section on Virtual Earth including a new site gallery for you to upload your sites, new articles on Version 6, including getting started guide, an interactive quick guide, location finder and more. Subscribe to the VWL aggregated blog to stay in touch with everything Live Services related. Find all the great content from this site and much, much more. Explore how other Live Services can compliment Virtual Earth and your applications.
Version 5 URL changed - Error: 'VEMap' is undefined on Via Virtual Earth Blog
It has been reported that the old url to access the Version5 javascript for Virtual Earth no longer works. This is effecting sites worldwide.
The correct way to reference the Version 5 javascript is:
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
If you have been effected a forum thread has been started here
Silverlight Virtual Earth viewer on Via Virtual Earth Blog
With the launch of silverlight yesterday I was digging around and found this viewer for Virtual Earth by Greg Schechter. It does use the 1.1 alpha of silverlight. It gives some interesting ideas for where Virtual Earth could be headed. Certainly the demo of the performance of silverlight compared to javascript for processing showed a significant increase. This could be very useful.
And of course on the gamer front check this out by Andy Beaulieu and shoot down some UFO's over Birdseye images.
John.
So much new Virtual Earth Imagery Worldwide. on Via Virtual Earth Blog
I subscribe to all the VE blogs and recently the posts about updated imagery has been more and more frequent.
The latest is here and for myself downunder we saw three updates, Canberra, Newcastle and Uluru:


Derek Chan posts 3 Articles in a month! on Via Virtual Earth Blog
A big thank you to the efforts of Derek Chan who posted his third VE article today (he actually had it ready weeks ago but had to wait for Mr Bottleneck here at VVE ;) )
The 3 articles are all relivant to Version 5 of Virtual Earth and deal with the Mini Map, debugging javascript and now custom pins in routes.
All these can now be found in our articles section.
If you have something to contribute send us an email.
John (The bottleneck)
Virtual Earth Commercial; What and Where Proxies RSS
This article is written for an old version of the Virtual Earth platform. While still available for reference purposes, it is unlikely to work if implemented.
As outlined in previous articles, in order to use Virtual Earth on a commercial website Microsoft has provided a special "commercialized" version of the MapControl. The idea behind this control is that Microsoft allows you to use the control for free but reserves the right to place advertising on the control. The advertising will come in the form of geographically relevant content based on the searches carried out by the user.
In order to get the searches working on the Virtual Earth commercial control you will need to implement two pages on your server that act as proxies to the actual searches on the MSN site. The two searches are for are the ads (what) and the location (where).
We've written a version of these proxies taking advantage of the generic HTTP handler (ASHX) feature of ASP.NET 2.0. What.ashx and Where.ashx source code below:
<%@ WebHandler Language="C#" Class="What" %>
using System;
using System.IO;
using System.Web;
using System.Net;
using System.Text;
public class What : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
if (context.Request.QueryString.Count > 0)
{
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://virtualearth.msn.com/ads.ashx");
myHttpWebRequest.Method = "POST";
myHttpWebRequest.ServicePoint.Expect100Continue = false;
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
UTF8Encoding myUTF8Encoding = new UTF8Encoding();
byte[] bytes = myUTF8Encoding.GetBytes(String.Format("a={0}&b={1}&c={2}&d={3}", context.Request["a"], context.Request["b"], context.Request["c"], context.Request["d"]));
myHttpWebRequest.ContentLength = bytes.Length;
Stream myRequestStream = myHttpWebRequest.GetRequestStream();
myRequestStream.Write(bytes, 0, bytes.Length);
myRequestStream.Close();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Stream myResponseStream = myHttpWebResponse.GetResponseStream();
Encoding myEncoding = Encoding.GetEncoding("utf-8");
StreamReader myStreamReader = new StreamReader(myResponseStream, myEncoding);
// Read 256 characters at a time
StringBuilder myStringBuilder = new StringBuilder();
Char[] buffer = new Char[256];
int count = myStreamReader.Read(buffer, 0, 256);
while (count > 0)
{
myStringBuilder.Append(new String(buffer, 0, count));
count = myStreamReader.Read(buffer, 0, 256);
}
myHttpWebResponse.Close();
context.Response.ContentType = "text/html";
context.Response.Write(myStringBuilder.ToString());
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
<%@ WebHandler Language="C#" Class="Where" %>
using System;
using System.IO;
using System.Web;
using System.Net;
using System.Text;
public class Where : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
if (context.Request.QueryString.Count > 0)
{
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://virtualearth.msn.com/search.ashx");
myHttpWebRequest.Method = "POST";
myHttpWebRequest.ServicePoint.Expect100Continue = false;
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
UTF8Encoding myUTF8Encoding = new UTF8Encoding();
byte[] bytes = myUTF8Encoding.GetBytes(String.Format("a={0}&b={1}&c={2}&d={3}&e={4}&f={5}&g={6}&i={7}&r={8}", context.Request["a"], context.Request["b"], context.Request["c"], context.Request["d"], context.Request["e"], context.Request["f"], context.Request["g"], context.Request["i"], context.Request["r"]));
myHttpWebRequest.ContentLength = bytes.Length;
Stream myRequestStream = myHttpWebRequest.GetRequestStream();
myRequestStream.Write(bytes, 0, bytes.Length);
myRequestStream.Close();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Stream myResponseStream = myHttpWebResponse.GetResponseStream();
Encoding myEncoding = Encoding.GetEncoding("utf-8");
StreamReader myStreamReader = new StreamReader(myResponseStream, myEncoding);
// Read 256 characters at a time
StringBuilder myStringBuilder = new StringBuilder();
Char[] buffer = new Char[256];
int count = myStreamReader.Read(buffer, 0, 256);
while (count > 0)
{
myStringBuilder.Append(new String(buffer, 0, count));
count = myStreamReader.Read(buffer, 0, 256);
}
myHttpWebResponse.Close();
context.Response.ContentType = "text/html";
context.Response.Write(myStringBuilder.ToString());
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
Article contributed by Shawn Miller. Have you got something to contribute?


