Paul Mendoza C# blog
Tuesday, June 27, 2006
  Google maps, Virtual Earth and Yahoo Maps API sets

Recently I’ve been playing with three API sets for the mapping solutions that Google, Yahoo and Microsoft and while the three all have pretty easy to use API’s, they all have some fairly large problems. Here are my personal thoughts on them.

Google Maps

Pros - What an amazing looking API. Probably took about 5 minutes to get a map on a screen. Another 10 minutes to add a couple of navigation features and tweak them around. It doesn’t require any difficult scripting and their examples gave me pretty much everything I needed to know how to do. There is also a lot of support since it’s a pretty popular and people just seem to love stuff Google does although I think the company of Google is losing it’s moto of “do no evil.” That’s a subject for a whole other post though.

Cons –There is a rate limit on the number of geocoding that each user key can do. The geocoding rate limit is 50,000 per day which is a lot so probably isn’t a big deal for 99% of people. If you’re not familiar with the term geocoding, it’s taking a text address and converting it into a latitude and longitude that’s quick to find on a map when loading the map at a later time. The next biggest problem is that in order to register and use the API, the site has to be posted on an open page on the internet. What if you’re doing test development on a local server using localhost as the address? Then you’ve got problems and Google just isn’t going to work for you. This means that Google maps was basically a non-starter since I don’t develop on the public internet and I can’t imagine many other developers building their applications on actual domains like Google is requiring. This seemed pretty absurd to limit developers like this. Anyone know of a way to get around this? I’d appreciate the help.

Microsoft Virtual Earth v3

Pros – Again, their API is fairly easy to use like Google’s and Yahoo! Much of their API is exactly the same as Google’s except for a few small things and the names of their functions. But my favorite part of it was that there aren’t any limits like on the Google API. I couldn’t find anywhere on the site that they mention any geocoding limits or limits on the number of visitors that can look at the maps. The API also doesn’t require a key.

Cons – Geocoding is broken. Well, you can give the map API a street address and it’ll find it but trying to find the LatLong is pretty much broken. How can this be broken? I mean, it’s such a basic feature that you almost have to have. It’s obviously a bug and not something that they intended since their own documentation even states that it should work and how but obviously it doesn’t. The part that’s broken is the Find function. Here is an example.

Lets say you’re looking up the street address of a location and you need to get the latitude and longitude so that you can store it in your database and quickly look it up later. So you’d use something like what they have on in their documentation which is pretty much the javascript I’ve copied and pasted here and made a couple changes to.

function Find()

{

map.Find(null,'Las Vegas, NV','1',onFindResults);

}

function onFindResults(findResults)

{

Var lat = findResults[i].LatLong.Latitude;

Var long = findResults[i].LatLong.Longitude;

    

}


 

Obviously this example code does nothing useful but what should happen is that you would call the Find() function, it would initiate an asynchronous call to the server and the callback is set to the onFindResults() function which then executes and performs whatever operations it needs on the findResults function which contains the LatLong object. Based on their documentation, using a null value in the map.Find() function as the first parameter should still do a search on the second parameter, the street address, and return a LatLong object inside of the findResults object. It doesn’t happen though.


 

If you have a map on the screen, when the callback happens, the map will reposition to the correct place but the actual function it’s supposed to point to callback to never gets executed which means that doing a search on just an address in order to get the Latitude and Longitude coordinates is very difficult. One solution might be to add an event listener for the change of the map coordinates when the value is returned. It’s not an optimal solution though.


 

The nice thing is that you can register an event handler so you can register an onmapchange event and when the map relocates, the event will fire and then you can grab the map object’s LatLong object.


 

Does anyone know when Microsoft is planning to fix this bug so that we don’t have to use the hack for their geocoding?


 

Yahoo! Maps


 

Pros – Yahoo! Maps is just as easy to setup as the last two. It probably ranks between Google and Microsoft. It required that I setup a key with them but this key is just a word instead of the massive string that Google required. Adding markers and content was very simple and I can really see this tool being nice to use. The Flash version I think is better looking than the Microsoft and Google versions actually. Some people disagree with me but I think the Flash looks better. I played with their AJAX version which had about the same functionality as the Google version.


 

Cons – There is a 50,000 usage limit for the map per day and a 5,000 geocode limit per day. That’s really low. It would be pretty easy for me to geocode far more than 5000 things a day if I’ve got 100 things on a map. That’s only 50 page views for the map and I’ve run out for the day. But they also make it easier to geocode than Google and Microsoft do. The problem is that their really easy method also doesn’t seem to have an easy way to get at the Lat and Long coordinates. They make it really easy to pass in an address and the map will center on that point. Maybe I just haven’t looked into this enough but I thought that was a major issue.

Another problem that I’ve been noticing is that their maps seem to load slower than Google and Microsft’s do. I’m not sure why this is but it’s quite noticeable at times although Microsoft’s at times is a bit sluggish, it’s nothing like how bad Yahoo! is at other times. Does anyone know of a way to optimize this?


 


 

Overall thoughts


 

Overall I’ve been pretty impressed with how easy the three solutions are to use for the basics tasks that would be required from the API maps. The best one I think is probably Yahoo! for it’s general features and usability. Then the Virtual Earth API and last would be the Google Maps just because of the horrible limitation of requiring a public dev environment. I’m even thinking of adding a map to this page. Maybe I’ll do that tonight but I’m not sure what it would point to. I’m not sure I really want everyone to be viewing aerial photos of my house as their first introduction to me.


 


 

 
Comments:
to get around the domain issue for google maps. just put the domain as localhost and you are all set.
 
Hi there Paul,
Do you have any source code samples or projects you would be willing to share on connecting to the various mapping spaces using C#?
Thanks in advance,
Robert
 
Post a Comment





<< Home
I am currently an ASP.NET, C# developer working on MangosteenNation.com, a XanGo website for helping people build their businesses. I am also pursuing a degree at CSU San Marcos in Southern California.

XanGo at Mangosteen Nation

Archives
October 2005 / November 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / April 2007 / May 2007 / June 2007 / August 2007 / February 2008 / August 2008 /


Powered by Blogger

Subscribe to
Posts [Atom]