| Demo |
Google Maps |
Yahoo! Maps |
| Source code |
function createGoogleMarker(point, text) {
var marker = new GMarker(point);
var html = "<b>" + text + "</b>";
GEvent.addListener(marker, 'click',
function() { marker.openInfoWindowHtml(html); });
return marker;
} // End createGoogleMarker
var gmap = new GMap(document.getElementById("gmap"));
var gPoint = new GPoint(-88.908749,36.301984);
var gMarker = createGoogleMarker(gPoint, "This is a message box.");
gmap.addControl(new GLargeMapControl());
gmap.addControl(new GMapTypeControl());
gmap.centerAndZoom( new GPoint(-88.849354,36.341402), 5 );
gmap.addOverlay( gMarker );
|
function createYahooMarker(point, text) {
var marker = new YMarker(point);
var html = "<b>" + text + "</b>";
YEvent.Capture(marker, EventsList.MouseClick,
function() { marker.openSmartWindow(html) });
return marker;
} // End createYahooMarker
var ymap = new YMap(document.getElementById("ymap"));
var yPoint = new YGeoPoint(36.301984,-88.908749);
var yMarker = createYahooMarker(yPoint, "This is a message box.");
ymap.addPanControl();
ymap.addZoomLong();
ymap.drawZoomAndCenter( "38237", 6 );
ymap.addOverlay( yMarker );
|
| Reference | Tutorial and Reference | Tutorial and Reference |
| Coverage | Earth | Northwest Hemisphere |
| Limits | 50,000 hits a day | 50,000 hits a day |
| Legal |
Applications must be freely available to everyone. Applications must not be used to facilitate illegal activities. You may not alter or obscure the logos or attribution on the map. Commercial use allowed. Terms of Service |
Applications must be freely available to everyone. Applications must not be used to facilitate illegal activities. Applications must not be incorporated into spyware or malware. Non-commercial use only. Terms of Service |
| Point API Call | new GPoint( Longitude, Latitude ); | new YGeoPoint( Latitude, Longitude ); |
| Importing XML | Google allows you to import XML through a generic "GXmlHttp" object, but you have to parse an XML document yourself using the "request.responseXML" object. XML files can look like whatever you want them to look like. | Yahoo allows you to import XML through a single call to "YGeoRSS" which points to your XML file. The XML file must follow Yahoo's GeoRSS standard. This standard is based on the W3's GeoRSS standard, and Yahoo has made several additions to take advantage of their geocoding features. |
| Geocoding | None. Google suggest you use a third party service. I suggest that you use Yahoo's REST API. | Yahoo has a simple geocoding service built into the API. (The demo above finds Martin, TN by zip code.) Yahoo also offers an independent REST API service when a more fine-tuned approach to geocoding is needed. |
| Differences | Offers satellite and hybrid maps, and allows drawing of lines on map. | Offers several geocoding services. |
Conclusion:
The two services are fast, simple, and very useful. Google has the advantage of intergrated satellite maps, while Yahoo has the built-in
geocoding service. So what do you value more? Personally, I like my satellite maps. If I need a geocoding service, I'll intergrate Yahoo's
geocodeing REST API into my Google Maps application. Yahoo has one key feature that I haven't mentioned: They also own the web service
Flickr. I expect future versions of Yahoo's API to include calls to Flickr so that people can build
traveling photo albums.
UPDATE: After they reddit, people digg APIs and think it's del.icio.us. So how soon till it's farked?
James Church
jcchurch@gmail.com
March 22, 2006