I have utilized AngularJS to create a map displaying several branches leading to a shop. I have stored branch information in an array and successfully displayed them on the map.
$scope.locations = {
BranchAndAtms: [
{
id: "1",
outlet: "Piliyandala",
address: "Piliyandala Post Office Piliyandala",
lat: "6.802107",
lon: "79.921749",
isAtm: "yes",
status: "yes",
map: map,
tel: "0111231231"
},
{
id: "2",
outlet: "Monaragala",
address: "No.100, New Bus Stand , Monaragala.",
lat: "6.877530",
lon: "79.907055",
isAtm: "yes",
status: "yes",
map: map,
tel: "0111231231"
},
]
}
Additionally, I am able to obtain my current location using
var myLatLng = new google.maps.LatLng(c.latitude, c.longitude);
Currently, I can display a route to a specified branch location. However, I am seeking guidance on how to extract latitude and longitude values from my array, compare them with my current location, and dynamically showcase the route. How can I achieve this?