|
Google Maps is the most well known of the various mapping web services. With a rich JavaScript API, road maps, route planning, satellite images, and data plotting; Google Maps offers similar services and maps as Microsoft's competing Virtual Earth service. Google Maps should not be confused with Google's other mapping product, Google Earth. Google Earth operates through a standalone executable or a control. In contrast, Google Maps is a JavaScript control that operates from within a web page or similar environment. As an early AJAX application, Google Maps is often given as an example of the advantages of using AJAX (Asynchronous Javascript XML). Changes in map viewing parameters do not require the entire web page to be re-loaded. Instead, the data is seamlessly loaded in the background and cached. This results in a much improved user experience. For performance reasons, Google Maps uses JSON for data transfer and not the 'traditional' XML of AJAX.
The main Google Maps site is at http://maps.google.com/. The standard user interface includes road maps, satellite images, terrain maps, and traffic reports; although these are not available for all locations. This is what the standard user interface looks like:

Google provide the Google Maps API as a free service for non-commercial use, but reserve the right to display advertising at a future date. The Google Terms and Conditions should be consulted regarding commercial applications. The API allows Google Maps to be embedded in a web site, and requires a key. This key can be freely obtained from Google, but it allows Google to control over-use and request flooding. The API documentation can be found at http://code.google.com/apis/maps/documentation/ . The following simple example is based on the interactive distance calculator at http://www.mileage-charts.com. This example searches for the start and end locations. If both are found, then the route is calculated and displayed on the map. Google Maps can provide the route directions, although they are not used in this example. ERROR [include_code_listing plugin]: File Not Found (/usr/www/users/winwaed/geowebguru/img/2009/googlemaps_example.html)
All of the calls to Google Maps are contained in the initialize() and handleErrors() JavaScript functions. initialize() creates the map, and calculates the route. Note that the distance and travel time results are extracted using an un-named embedded function attached to the 'load' event. With active competition from Microsoft's Virtual Earth, Google Maps continues to see regular improvements in functionality, the API, and data coverage. This active competition will continue to strengthen both products for at least the next year or so. This can only be a good thing.
|