Refactors Google Maps API call into single function. Route recalculates correctly when route is extended, truncated, and reset.