Skip to content

Commit acfe354

Browse files
committed
TS style fixes
1 parent 400eee5 commit acfe354

File tree

4 files changed

+38
-30
lines changed

4 files changed

+38
-30
lines changed

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"@angular/cli": "1.1.1",
3535
"@angular/compiler-cli": "^4.0.0",
3636
"@angular/language-service": "^4.0.0",
37-
"@types/googlemaps": "^3.29.2",
3837
"@types/jasmine": "2.5.45",
3938
"@types/node": "~6.0.60",
4039
"codelyzer": "~3.0.1",

src/app/common/states/gmaps.service.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export class GMapsDirectionsService {
2222

2323
updateDirections() {
2424
this.gmapsApi.getNativeMap().then(map => {
25-
//Prepare Map and Display Settings
25+
// Prepare Map and Display Settings
2626
if (!this.originPlaceId || !this.destinationPlaceId) {
2727
return;
2828
}
2929

30-
var directionsService = new google.maps.DirectionsService;
31-
var service = this;
32-
var origin = new google.maps.LatLng({ lat: this.origin.latitude, lng: this.origin.longitude });
33-
var destination = new google.maps.LatLng({ lat: this.destination.latitude, lng: this.destination.longitude });
30+
const directionsService = new google.maps.DirectionsService;
31+
const service = this;
32+
const origin = new google.maps.LatLng({ lat: this.origin.latitude, lng: this.origin.longitude });
33+
const destination = new google.maps.LatLng({ lat: this.destination.latitude, lng: this.destination.longitude });
3434

3535
this.directionsDisplay.setMap(map);
3636
this.directionsDisplay.setOptions({
@@ -41,31 +41,30 @@ export class GMapsDirectionsService {
4141
}
4242
});
4343

44-
//Update Display
44+
// Update Display
4545
this.directionsDisplay.setDirections({ routes: [] });
4646

47-
//Determine Directions
48-
//Request
47+
// Determine Directions
48+
// Request
4949
directionsService.route({
5050
origin: { placeId: this.originPlaceId },
5151
destination: { placeId: this.destinationPlaceId },
5252
avoidHighways: true,
5353
travelMode: google.maps.DirectionsTravelMode.DRIVING
54-
},
55-
//Response
54+
},
55+
// Response
5656
function (response: any, status: any) {
5757
if (status === 'OK') {
5858
service.directionsDisplay.setDirections(response);
5959
map.setZoom(30);
60-
var point = response.routes[0].legs[0];
60+
const point = response.routes[0].legs[0];
6161
service.estimatedTime = point.duration.text;
6262
service.estimatedDistance = point.distance.text;
6363
console.log('Estimated travel time: ' + point.duration.text + ' (' + point.distance.text + ')');
6464
} else {
6565
console.log('Directions request failed due to ' + status);
6666
}
6767
});
68-
6968
});
7069
}
7170

src/app/passengers/components/smart/trip-planner/trip-planner.component.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,49 +23,49 @@ export class TripPlannerComponent implements OnInit {
2323
@Input() private estimatedTime: any;
2424
@Input() private estimatedDistance: any;
2525

26-
@ViewChild("pickupInput")
26+
@ViewChild('pickupInput')
2727
public pickupInputElementRef: ElementRef;
2828

29-
@ViewChild("pickupOutput")
29+
@ViewChild('pickupOutput')
3030
public pickupOutputElementRef: ElementRef;
3131

3232
@ViewChild(GMapsDirectionsService) service: GMapsDirectionsService;
3333

3434
constructor(
35-
private ngZone: NgZone,
36-
private mapsAPILoader: MapsAPILoader,
37-
private gmapsApi: GoogleMapsAPIWrapper,
35+
private ngZone: NgZone,
36+
private mapsAPILoader: MapsAPILoader,
37+
private gmapsApi: GoogleMapsAPIWrapper,
3838
private _elementRef: ElementRef) {
3939
}
4040

4141
ngOnInit() {
42-
//Default Map View
42+
// Default Map View
4343
this.latitude = 26.089595;
4444
this.longitude = -80.366791;
4545
this.zoom = 14;
4646

4747
this.destinationInput = new FormControl();
4848
this.destinationOutput = new FormControl();
4949

50-
//Update Map View
50+
// Update Map View
5151
this.setCurrentPosition();
52-
53-
//Load Autocomplete for Inputs
52+
53+
// Load Autocomplete for Inputs
5454
this.mapsAPILoader.load().then(() => {
55-
let autocompleteInput = new google.maps.places.Autocomplete(this.pickupInputElementRef.nativeElement, {
56-
types: ["address"]
55+
const autocompleteInput = new google.maps.places.Autocomplete(this.pickupInputElementRef.nativeElement, {
56+
types: ['address']
5757
});
5858

59-
let autocompleteOutput = new google.maps.places.Autocomplete(this.pickupOutputElementRef.nativeElement, {
60-
types: ["address"]
59+
const autocompleteOutput = new google.maps.places.Autocomplete(this.pickupOutputElementRef.nativeElement, {
60+
types: ['address']
6161
});
6262
this.setupPlaceChangedListener(autocompleteInput, 'pickup');
6363
this.setupPlaceChangedListener(autocompleteOutput, 'destination');
6464
});
6565
}
6666

6767
setCurrentPosition() {
68-
if ("geolocation" in navigator) {
68+
if ('geolocation' in navigator) {
6969
navigator.geolocation.getCurrentPosition((position) => {
7070
this.latitude = position.coords.latitude;
7171
this.longitude = position.coords.longitude;
@@ -74,9 +74,9 @@ export class TripPlannerComponent implements OnInit {
7474
}
7575

7676
private setupPlaceChangedListener(autocomplete:any, inputType:string) {
77-
autocomplete.addListener("place_changed", () => {
77+
autocomplete.addListener('place_changed', () => {
7878
this.ngZone.run(() => {
79-
let place: google.maps.places.PlaceResult = autocomplete.getPlace();
79+
const place: google.maps.places.PlaceResult = autocomplete.getPlace();
8080
if (place.geometry === undefined) {
8181
return;
8282
}
@@ -104,7 +104,7 @@ export class TripPlannerComponent implements OnInit {
104104
}
105105

106106
onFindRideClick(event) {
107-
console.log("Clicked find ride.");
107+
console.log('Clicked find ride.');
108108
}
109109

110110
}

0 commit comments

Comments
 (0)