Skip to content

Commit

Permalink
Merge pull request #196 from Nintails-TF/FE/fixing-google-maps-button
Browse files Browse the repository at this point in the history
FE/fixing-google-maps-button
  • Loading branch information
AmSmef authored Feb 1, 2024
2 parents 6413802 + e33ddfd commit 5b77c7c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion fe/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,23 @@ <h4 class="font-medium">Please allow location services...</h4>

// 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;
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 5b77c7c

Please sign in to comment.