Consolidating functions into a GmapsDirections javascript 'class'. Tested addStops and removeStops in jsfiddle, but will need to continue testing on wordpress site.
Fixed bug with semicolon in JSON object.
Use default option later in call. Google may not be defined here. google.maps.DirectionsTravelMode.DRIVING;
Needed to move call to directions.setDirections inside eventListener call back so that 'e' is in scope.
Corrected spelling on function call.
Adding a start div below map and above results to store and update the startPoint.
Trying different options with map directions.
Improving look of startDiv. Added a label.
Fixed string mistake, adding fix for icons being too close to results text, and added function comments.
Put in some logic to display different message in infoWindow if a starting point has already been set. Also fixed overlapping text problem. Forgot that '$' is not available, need to use 'jQuery'.
Fixed problem with missing document before getElementById function. Also, previous commit commented out the go to top of map functionality when a marker is clicked.
Removing last waypoint because it is doubling as destination. Also removed input text if it's not the first point to be added and shortened label in infowindow.
Big commit. Improvements with business logic in handling first address click and subsequent ones. Does not add startPointDiv until after first address click, etc.
Trying to clean it up and prevent a javascript error.
Needed to change variable name, can't have hyphens.
Clarifying start variables and values.
Need to send value of html element for start address.
Changed get_directions_text for results from "Get Directions" to "Add to Trip" and made click action computeDirections so had to add another case to computerDirections (params are starting to get tricky).
Tried to fix button so it appears in startPointDiv.
Fixed a string issue and changed to single quotes rather than escaping double-quotes.
Fixed a string issue in the results link where "Get Directions" is changing to "Add to Trip".