Updated Ryan's code for gmap center and polyline.
Added more calculations.