Our Friends

MP2K Mag

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:

CanberraAUUluruAUNewcastleAU

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)

Obtaining the Visitor's Location 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.

In this tutorial I'll explain how you can obtain the location of the visitor viewing your page. I used this technique in my MapStats application.

Normally, you'd need to have a huge database to map ip addresses to their corresponding coordinates. However, obtaining such a database and keeping it updated can be quite hard. That's why we'll want to use another method.

We'll make something much like the 'Locate me' function at the official Virtual Earth website. We'll even be using the same webservice!

The locate me function gets its information from this URL: http://virtualearth.msn.com/WiFiIPService/locate.ashx.

This file outputs something like:

SetAutoLocateViewport(51.533333, 5.983333, 10, false, 'Virtual Earth has determined your location by using your computer\'s IP address.');

This is very useful information. We can now use this page by simply creating our own SetAutoLocateViewport function. We'll only need to use the first two parameters. It will look like this:

<script type="text/javascript">
function SetAutoLocateViewport(latitude, longitude, lvl, bl, msg)
{
  alert('You\'re positioned at:\nLatitude: '+latitude+'\nLongitude: '+longitude);
}
</script>

The function has now been defined. Now we'll need to make sure it gets called with the correct parameters. We can obviously do this by including Microsoft's locate me script file!

<script type="text/javascript" src="http://virtualearth.msn.com/WiFiIPService/locate.ashx"></script>

Of course, you can do many more things by modifying this script. You can easily change the SetAutoLocateViewport function to add a pushpin at your visitor's location for example.

Update: Tatham Oddie of Fuel Advance pointed out a problem which occurs when the Virtual Earth script can't obtain the correct location of the visitor (which is very rare). The Virtual Earth script then outputs something else:

ShowMessage("Virtual Earth cannot determine your current location. Try again later.");

Obviously we can easily create a handler for this function, which would look like this:

function ShowMessage(message)
{
  alert('VE locate message:' + message);
}

Good luck with your application!

Article contributed by Yousef El-Dardiry. Have you got something to contribute?

Rating

What did you think?

Not signed in. Sign in or sign up?

Others thought...

Nobody has rated this item yet.

Why don't you start?