Thanks to the new Distance Matrix service, which we are launching today, I can now relive these moments from my youth. The Distance Matrix service is a simple and efficient way to obtain the travel distance and time between many locations when you do not need the full route details for any individual pair. The below applications generates a distance matrix for walking from major London railway stations to several London landmarks. Roll your mouse over the matrix cells, or tap a cell, to see the relevant route.
The Distance Matrix service is also useful for sorting or filtering search results. For example, let’s say your Maps API application enables users to find nearby grocery stores and you want to present the results sorted by drive time. The locations are stored in a spatial database such as Google Fusion Tables, which can return all stores within a given straight line distance. Using the Distance Matrix service you only need one more query to obtain the drive time from the user's location to each of those stores in order to sort them accordingly.
The Distance Matrix service is available for use directly in the JavaScript Maps API as well as a web service returning JSON or XML. To get started, take a look at the Maps API services documentation, and the Distance Matrix API web service documentation.
No comments:
Post a Comment