Need to create two functions related to Google Maps Api

Job ID: 32000196

Budget: $10 – $30 USD

I need you to make two functions for me.

1. I have a google map that i am using to capture delivery cordinates of the user. There is 50 km circle around the shop corrdinates. I need to restrict the user to not be able to go out of the circle. Second i need to calculate the distance from the shop to the coordniates that the user picks. Check attacment for example

2. Second i need to show the route being taken by the driver to the user. I am already capturing the coordinates of the driver in real time. so just need to show it in a map with maybe estimated time of arrival.