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)
Free reverse geocoding RSS
This article describes how a website VoyageMap.com utilises a free reverse geocoding data dump from Geonames.org
I restricted the locations to worldwide cities with greater than 1000 residents. This file was available from http://www.geonames.org/ as a data dump. But you can use their free webservice as well by providing Lat and Long values to http://ws.geonames.org/findNearbyPlaceName?lat=47.3&lng=9
Free reverse geocoding by supplying Lat and Long values.
After downloading Cities data dump and importing into my local database I set up a stored procedure to bring back locations that meet the radius parameter and passed in Lat Long values in following sql
SELECT TOP 3
Country.name as country, City.geonameid,City.name, City.latitude, City.longitude,
Avg(3958.75 * ACos(Sin(@Latitude/57.2958) *
Sin(City.Latitude/57.2958) +
Cos(@Latitude/57.2958) *
Cos(City.Latitude/57.2958) *
Cos(City.Longitude/57.2958 - @Longitude/57.2958))) AS miles
FROM
dbo.GeoNamesCity City
join dbo.GeoNamesCountry Country on City.[country code] = Country.[iso alpha2]
WHERE City.Longitude IS NOT NULL AND City.Longitude <> 0
AND City.Latitude IS NOT NULL AND City.Latitude <> 0
AND @Miles >=
(
3958.75 * ACos(Sin(@Latitude/57.2958) *
Sin(City.Latitude/57.2958) +
Cos(@Latitude/57.2958) *
Cos(City.Latitude/57.2958) *
Cos(City.Longitude/57.2958 - @Longitude/57.2958))
)
GROUP BY Country.name, City.geonameid,City.name, City.latitude, City.longitude
ORDER BY miles
Website users can retrieve upto 3 nearest cities to add travel review by right clicking on map
I used the following code to register the click event
map.AttachEvent("onclick",PopupMenu);
Following is how the event is then handled to popup a menu for users to click on to add review, you can see that left click removes the menu
function PopupMenu(e)
{
if (e.eventName == "onclick")
{
if (e.leftMouseButton)
{
RemovePopupMenu(e);
}
else if (e.rightMouseButton)
{
var menu = document.getElementById('popupmenu');
menu.style.left = e.mapX + 'px' ;
menu.style.top = e.mapY + 'px' ;
menu.style.display='block';
popupmenupoint = DoPixelToLL(e.clientX,e.clientY);
}
}
}
To remove the menu
document.getElementById('popupmenu').style.display='none'
I used a web service to query the database and bring back list of cities (you can also use geonames webservice rather than setup your own), the popupmenupoint variable in javascript holds the LatLong values to run against the geonames data dump.
The site heavily uses AJAX model to give users a seamless experience
Conclusion:
For private websites on a limited budget using MapPoint API is an expensive part of retrieving locations by passing Lat Long values, however with free data sources and web services available you can easily integrate reverse lookup into your website.
I would like to thank geonames.org and viavirtualearth.com to allow me to use their data and code snippets that helped in producing this website.
Article contributed by Mo Majad (VoyageMap.com). Have you got something to contribute?


