let distanceService = new google.maps.DistanceMatrixService();
distanceService.getDistanceMatrix({
origins: [sourceLocation],
destinations: [destinationLocation],
travelMode: google.maps.TravelMode.DRIVING,
unitSystem: google.maps.UnitSystem.IMPERIAL,
avoidHighways: false,
avoidTolls: false
})
Although I tried to switch the units from kilometers to miles with this code, it doesn't seem to be working properly. My aim is to establish a connection to an area using Google Maps and display distances in miles.