I am working on an app for a fast food customer service using Google maps API. The customer service worker should be able to add a marker on the map (containing the caller address) and automatically the map should show him which is the closest branch to the caller (The new marker just got added by the worker).
I could show the branches as markers from an array and I could add the new marker to the map, nevertheless did not find anywhere possible to calculate the distance between the old markers and the new added marker.
Except that I found this that calculate from the current location and not from an added marker which is still far from what I need.
Anyone could give me specific code for how to do it?