GoogleMaps Directions API wrapper control demonstration

This page shows the following two ASP.NET user controls in action:

  • GoogleDrivingDirections: A wrapper control for GoogleMaps driving directions API, which loads driving directions in a div element of its own. If the ID of another div element is assigned to it's MapElementID property, it will also load a basic map showing the directions on it. The directions and the map are synchronized, so if you click on a step on the directions, it will bring up a closer view of that step on the map. This control does not provide input elements to accept start and end address, you must assign them in code.
  • DirectionsAPI_Sample: Another user control that uses GoogleDrivingDirections wrapper control along with input elements to show complete example that displays driving directions based on user entered start and end address.

Srcoll down below the directions to see more information on these controls. You may download these controls here.

Start Address
 
Destination
 



GoogleMaps Driving Directions
No api key is needed for running it on localhost.
But you will need an api key for the production URL.
You may obtain a key from code.google.com

If you would like to provide a driving direction lookup between any two addresses in USA, you may use the DirectionsAPI_Sample user control and modify it to fit your layout and design. In most cases, however, you probably want to have a fixed destination address, and users would enter the starting address, to get driving directions to a store location etc. The GoogleDrivingDirections wrapper control will be a better choice in that case.

GoogleMaps Directions API accepts flexible address formats. You can lookup directions between two cities, zip codes, complete address or any combination of them.

You can't lookup directions between two states though! But that only makes sense.