Need Sea Route with Google Map

I am looking for the Javascript or PHP version to display the sea route between 2 ports’ coordinates in Google Maps. And I have to place ships marker in the sea route depends on their actual coordinates. I have a MySQL database table contains ports name and its lat/long and lat/long of the ships will be updated regularly.