O'Reilly logo

Google Maps JavaScript API Cookbook by Balkan Uraz, Alper Dincer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a distance matrix for the given locations

The Google Maps JavaScript API carries some interesting and particularly helpful properties, one of them being the Distance Matrix Service. Using this service, you can compute the travel time and distance between multiple origins and destination locations.

This is especially useful when you want to have a one-to-one report of your travel nodes, be it a delivery business or only a summertime holiday. This service gives you the travel time and distances within your choice of travel mode (driving, walking, and cycling); you can see the results oriented for each origin and destination.

It is worth noting that the output of this service cannot be mapped onto the base maps; you can have the information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required