Skip to content

Commit

Permalink
Merge branch 'FE/filters' of https://github.com/Nintails-TF/ncr-agile…
Browse files Browse the repository at this point in the history
…-wombo into FE/filters
  • Loading branch information
KyleTait01 committed Feb 2, 2024
2 parents 70f9091 + 3166232 commit c18480f
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions fe/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,23 @@ <h4 class="font-medium">Please allow location services...</h4>
'right-2',
'ml-auto',
);
toMapButton.innerHTML = 'Open in Google Maps'

// Add a click event listener to open Google Maps with the specific latitude and longitude
toMapButton.addEventListener('click', function () {
var googleMapsUrl = 'https://www.google.com/maps?q=' + latitude + ',' + longitude;
window.open(googleMapsUrl, '_blank');
});
toMapButton.innerHTML = 'Open in Google Maps';

// Add a click event listener to open Google Maps with the specific latitude and longitude
toMapButton.addEventListener('click', function () {
var query; // Initialize query variable
if (branch.type === 'ATM') {
// For ATMs, use only the address
query = branch.address;
} else {
// For branches, use the branch name and address for specificity
query = "Santander Branch " + branch.address;
}

var encodedQuery = encodeURIComponent(query); // Encode the query for URL
var googleMapsUrl = 'https://www.google.com/maps?q=' + encodedQuery;
window.open(googleMapsUrl, '_blank');
});
detailsColumn.appendChild(toMapButton);

marker.addEventListener('click', function(){
Expand Down

0 comments on commit c18480f

Please sign in to comment.