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)
Use multiple instances of Virtual Earth V5 RSS
One possible application of Virtual Earth, other than the classic application of one instance, is the use of multiple instances of VE, inside one single page.
With the last release of VE, Microsoft has introduced a new functionality about mouse and keyboard events. Specifically, you can use VEMap.AttachEvent Method, to synchronize one or more instance of VE with one principal instance.

Figure 1 - Virtual Earth in dual view
First of all, you need to insert in the page two instances of VE, defining and initialising two map variables:
var map = null;
var map1 = null;
Then you need to insert two functions, one for every map:
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap(new VELatLong(41.8384869319255,15.9580442928227),11, 'r', false, VEMapMode.Mode2D, true);
map.AttachEvent("onendzoom",EndZoomHandler);
map.AttachEvent("onendpan",EndZoomHandler);
}
function GetMap1()
{
map1 = new VEMap('myMap1');
map1.LoadMap(new VELatLong(41.8384869319255,15.9580442928227),11, 'r', false, VEMapMode.Mode2D, true);
}
As you can see, in the first definition of th GetMap function, we use the method AttachEvent, for the zoom "onendzoom" and for the pan "onendpan". �In the definition of the event handler EndZoomHandler, we insert the code to handle the second instance of the map:
function EndZoomHandler(e)
{
var a = map.GetZoomLevel();
var b = map.GetCenter();
map1.SetCenterAndZoom(b,a);
}
Now me must call all the GetMap functions in the body of the page.
To obtain a correct layout of the two maps (DIV container) is sufficent to add a stylesheet with the correct style for the two maps:
#myMap
{
float: left;
border:#FFFF00 solid 2px;
}
#myMap1
{
float: right;
border:#009900 solid 2px;
}
Every time you pan or zoom on the map on the left, the event handler will set the same zoom and position on the map on the right. Naturally, the map on the left is completely independent from the other one. If we pan or zoom on the map on the right, the code will not update the map on the left.
With the same approach, it is quite simple to handle more than two maps.

Figure 2 - Virtual Earth three instances
Conclusion
More instances on VE you insert in your page, more time you must wait, until retrieve the data. But can be interesting adopt this scenario with custom tile layers, different for each map.

Figure 3 - Four instances of VE with different map style
Demonstrations
Article contributed by Sergio Minicozzi - Software Developer.
(MARSec - Mediterranean Agency for Remote Sensing and Environment Control)
Have you got something to contribute?


