diff --git a/resources/views/bank-data/index.blade.php b/resources/views/bank-data/index.blade.php index 00b184f..360e3c7 100644 --- a/resources/views/bank-data/index.blade.php +++ b/resources/views/bank-data/index.blade.php @@ -320,6 +320,12 @@ +
+
+ +
`; @@ -354,6 +360,26 @@ } } + + function getDirections(lat, lng) { + console.log('Getting directions to:', lat, lng); + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition( + (position) => { + const origin = position.coords.latitude + ',' + position.coords.longitude; + const destination = lat + ',' + lng; + const url = `https://www.google.com/maps/dir/?api=1&origin=${origin}&destination=${destination}`; + window.open(url, '_blank'); + }, + () => { + alert('Unable to get your current location. Please enable location services.'); + } + ); + } else { + alert('Geolocation is not supported by your browser.'); + } + } + function initializeDataTable() { const element = document.querySelector('#bank-data-table'); const searchInput = document.getElementById('search');