I’ve just gotten started with the Google Maps API and I’ve been following all the documentation. Currently I’m trying to use the Directions Service of the API, but nothing seems to render. Help?
Here is a directory with all of the files.
http://kkohlmorgen.com/googleAPI/
There may be other issues, but the first thing I notice is that you are trying to declare the directionsService when the page loads, but you don’t load the Google Maps API until you click the Load Map button. So it throws a “google is not defined” error when you declare directionsService. Thus, when you call directionsService later, it is undefined. You should load the Google Maps API before running any other map related javascript.