I am currently developing an application that necessitates the user to select a location, which will then guide them to the designated spot using Google Maps. The locations are stored as an array of JSON files. Below is an example of what the list looks like once compiled...
To rectify the backward coordinates in the JSON file, I have constructed the following code to split up the coordinates accordingly:
var FormatCoords = function(){
CoordinateToString = location.Point.coordinates.toString()
SplitCord = CoordinateToString.split(",")
$scope.Lat = SplitCord[1];
$scope.Lon = SplitCord[0];
var FinalCord = Lat.concat(Lon);
};
My inquiry is how can I trigger the above code to execute when a location is clicked?
If you wish to take a look at my code, you can access it via this Plunk: http://plnkr.co/edit/OZZRgiEcrLzreW3lrc5v?p=preview