Skip to content

Commit

Permalink
911948: added sample changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
indumathi-murali authored Oct 8, 2024
1 parent b036a49 commit b213ed5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ let map: Maps = new Maps({

map.appendTo('#container');

let Source: string;
let Destination: string;
let source: string;
let destination: string;
function initMap() {
const directionsService = new google.maps.DirectionsService();
const onButtonClick = function () {
Source = (
source = (
document.getElementById('input') as HTMLInputElement
).value.toLowerCase();
Destination = (
destination = (
document.getElementById('output') as HTMLInputElement
).value.toLowerCase();
if (
Source !== null &&
Source !== '' &&
Destination !== null &&
Destination !== ''
source !== null &&
source !== '' &&
destination !== null &&
destination !== ''
) {
calculateAndDisplayRoute(directionsService);
}
Expand All @@ -62,10 +62,10 @@ function calculateAndDisplayRoute(directionsService: any) {
directionsService
.route({
origin: {
query: Source,
query: source,
},
destination: {
query: Destination,
query: destination,
},
travelMode: google.maps.TravelMode.DRIVING,
})
Expand Down Expand Up @@ -95,4 +95,4 @@ function calculateAndDisplayRoute(directionsService: any) {
.catch((e : any) => window.alert('Directions request failed due to ' + status));
}

initMap();
initMap();

0 comments on commit b213ed5

Please sign in to comment.