Last week was the O'Reilly Where 2.0 Conference where a number of players in the online mapping space including Yahoo!, Google and MSN announced API plans for their various services.

The Yahoo! Maps Web Services provides a way display a map on the Yahoo! website populated with locations specified by the caller. To specify the locations on the map, one uses an RSS feed where each item in the feed corresponds to a location on the map and its geographical address is specified using a combination of geoRSS extensions and proprietary Yahoo! extensions. Instead of allowing one to POST the RSS feed to the service, the Yahoo! Maps API requires that a URL to the RSS feed is provided instead. This prevents the API from being used by desktop applications easily or by users who don't have access to a web server where they can place XML files online. Clicking on the following URL should show the API in action; http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps?appid=YahooDemo&xmlsrc=http://developer.yahoo.net/maps/sample.xml 

The Google Maps API allows one to embed Google Maps on specific web pages. To include a map on one's web page, a Javascript file which exposes a complete object model for Google Maps should be included on the target webpage. The Javascript include is of the form

<script src="http://maps.google.com/maps?file=api&v=1&key=abcdefg" type="text/javascript"></script>

file=api indicates that the file being returned is the Google API file, v=1 indicates that version 1 of the API is being requested and key=abcdefg is used to specify the developer key being used to access the service.

Once the script is included, developers can write code such as

var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(-122.141944, 37.441944), 4);

which results in an effect similar to those at controls.html being created on the Web page.

It's interesting to see how radically different the approaches taken by Yahoo! and Google to  provide what is basically the same functionality. The Yahoo! approach seems to me to be more declarative and straightforward than Google's approach. However, Google's approach is definitely a lot more flexible.

As for MSN, we announced that Virtual Earth will provide an API that will be free for non-commercial use that utilizes both URLs and a JScript Map control. Some of the highlights of the conference presentation are in Chandu Thota's post Where 2.0 and Virtual Earth.


 

Comments are closed.