This is my spagetti code that i have developed for my client. This Google Map application helps companies with more than one offices to show address of all in one map. Their website user selects one of office in selection box and application draw route from current location of user or his/her searched address.
- Select Start Point : User either searches for location on search box; or get his/her current location.
- Select Target Point : User selects one of given locations (in my case they were address of offices).
- Submit button to draw route from Start to Target points.
My spagetti is sauced with sample codes listed below :
auto complete : https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
auto complete v2 : https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-directions
direction service : https://developers.google.com/maps/documentation/javascript/directions
location selection : https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints
1- when place searched, put it into info box 2- when search - go to that place 3- if empty inputs, alert accordingly 4- CSS : input boxes should either be inside of map frame or outside.