views:

876

answers:

2

I have been pouring over the Google Maps API information, and for the life of me I can't seem to find an example, or figure out the exact right way of doing what I want.

From a simple HTML layout I need to display a Google Map, with a single address listed as a marker, with the user having the ability to click "Get Directions" or something similar to get driving directions.

I have a full address, but no Latitude or Longitude information. Does anyone have a good pointer, or a simple example of doing this that they could share?

+1  A: 

You can get the latitude and longitude of any address using "geocoder services" there are lots of services available for free. geocoder.us is a free service through which you can "geocode" any address in the USA. Also, look at the site http://googlemapsbook.com/geocoders/ to find out more such geocoders. However, I don't think there is an easy way to get the driving directions, As far as I know the Google Maps API doesn't expose such functionality.

Khaja Minhajuddin
Sure it does! See http://code.google.com/apis/maps/documentation/reference.html#GDirectionsIt may be that using the API is overkill for this particular case but the functionality is definitely available.
MatrixFrog
+3  A: 

You don't need to use the API for this. You can send a query directly to a Google maps object in an iframe.

For example, to show the White House:

 <iframe src="http://maps.google.com/maps?geocode=&amp;q=1600%20Pennsylvania%20Avenue%20NW,%20washington,%20DC" width="100%" height="300" >
  <p>Your browser does not support iframes.</p>
 </iframe>

The resulting map has a single address marker which allows the user to get directions.

flicken
Yeah, I just figured that out a little bit ago, was over complicating things a bit!
Mitchel Sellers