I have limited experience with javascript but I am determined to improve my skills. Currently, I am facing a major roadblock in a project that I am working on and urgently require assistance.
The project involves creating a map with marked locations from a dataset exported from a file on google docs. I have successfully populated the markers on the map and set up the infowindows.
My goal is to enable users to click on a marker on the map, then click on the Get Directions button in the infowindow to receive directions from their current location (using geolocation) to the selected marker's location.
Although I believe I am close to solving the issue, I am struggling to extract the latitudes and longitudes from my array and pass them into the getDir function. Any help would be greatly appreciated. Thank you in advance.
Here is the page displaying the current state of the map.
This is how I am initializing and setting the data on the map -
function initialize() {
// Map initialization code here
}
Below is my getDir() function where I am encountering difficulties -
function getDir(lat,lng) {
// Geolocation function
}