diff --git a/src/app/pages/maps/gmaps/gmaps.component.ts b/src/app/pages/maps/gmaps/gmaps.component.ts index 51da4857..a186733d 100644 --- a/src/app/pages/maps/gmaps/gmaps.component.ts +++ b/src/app/pages/maps/gmaps/gmaps.component.ts @@ -6,5 +6,5 @@ import { Component } from '@angular/core'; templateUrl: './gmaps.component.html', }) export class GmapsComponent { - public readonly position = { lat: 51.678418, lng: 7.809007 }; + readonly position = { lat: 51.678418, lng: 7.809007 }; } diff --git a/src/app/pages/maps/search-map/entity/position.model.ts b/src/app/pages/maps/search-map/entity/position.model.ts index c5f38f56..26f1e3cb 100644 --- a/src/app/pages/maps/search-map/entity/position.model.ts +++ b/src/app/pages/maps/search-map/entity/position.model.ts @@ -1,6 +1,6 @@ export class PositionModel { - public constructor( - public lat: number = 53.9, - public lng: number = 27.5667, + constructor( + public lat = 53.9, + public lng = 27.5667, ) {} } diff --git a/src/app/pages/maps/search-map/map/map.component.ts b/src/app/pages/maps/search-map/map/map.component.ts index b8d42cc3..657c6fb8 100644 --- a/src/app/pages/maps/search-map/map/map.component.ts +++ b/src/app/pages/maps/search-map/map/map.component.ts @@ -7,19 +7,18 @@ import { PositionModel } from '../entity/position.model'; styleUrls: ['./map.component.scss'], }) export class MapComponent implements OnInit { - public position: PositionModel = null; - public zoom: number = 1; + position: PositionModel = null; + zoom: number = 1; @Input() public set searchedPosition(position: PositionModel) { - if (!position) return; - - console.dir(position); - this.position = position; - this.zoom = 12; + if (position) { + this.position = position; + this.zoom = 12; + } } - public ngOnInit(): void { + ngOnInit() { // set up current location if ('geolocation' in navigator) { navigator.geolocation.getCurrentPosition((position) => { diff --git a/src/app/pages/maps/search-map/search-map.component.ts b/src/app/pages/maps/search-map/search-map.component.ts index 8fe5fbd6..43f66f8d 100644 --- a/src/app/pages/maps/search-map/search-map.component.ts +++ b/src/app/pages/maps/search-map/search-map.component.ts @@ -6,9 +6,9 @@ import { PositionModel } from './entity/position.model'; templateUrl: './search-map.component.html', }) export class SearchMapComponent { - public searchedPosition: PositionModel = new PositionModel(); + searchedPosition: PositionModel = new PositionModel(); - public setPosition(position: PositionModel): void { + setPosition(position: PositionModel) { this.searchedPosition = position; } } diff --git a/src/app/pages/maps/search-map/search/search.component.ts b/src/app/pages/maps/search-map/search/search.component.ts index 28ee1fac..5cb325ca 100644 --- a/src/app/pages/maps/search-map/search/search.component.ts +++ b/src/app/pages/maps/search-map/search/search.component.ts @@ -8,12 +8,12 @@ import { PositionModel } from '../entity/position.model'; export class SearchComponent implements OnInit { @Output() - public readonly positionChanged: EventEmitter = new EventEmitter(); + positionChanged: EventEmitter = new EventEmitter(); @ViewChild('search', { static: true }) - public searchElementRef: ElementRef; + searchElementRef: ElementRef; - constructor(private readonly ngZone: NgZone) {} + constructor(private ngZone: NgZone) {} ngOnInit() { const autocomplete = new google.maps.places.Autocomplete(