mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 16:30:13 +01:00
refactor: remove unnecessary access modifiers
This commit is contained in:
parent
3208c43a79
commit
d5ebe5ad4c
5 changed files with 16 additions and 17 deletions
|
|
@ -6,5 +6,5 @@ import { Component } from '@angular/core';
|
||||||
templateUrl: './gmaps.component.html',
|
templateUrl: './gmaps.component.html',
|
||||||
})
|
})
|
||||||
export class GmapsComponent {
|
export class GmapsComponent {
|
||||||
public readonly position = { lat: 51.678418, lng: 7.809007 };
|
readonly position = { lat: 51.678418, lng: 7.809007 };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
export class PositionModel {
|
export class PositionModel {
|
||||||
public constructor(
|
constructor(
|
||||||
public lat: number = 53.9,
|
public lat = 53.9,
|
||||||
public lng: number = 27.5667,
|
public lng = 27.5667,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,18 @@ import { PositionModel } from '../entity/position.model';
|
||||||
styleUrls: ['./map.component.scss'],
|
styleUrls: ['./map.component.scss'],
|
||||||
})
|
})
|
||||||
export class MapComponent implements OnInit {
|
export class MapComponent implements OnInit {
|
||||||
public position: PositionModel = null;
|
position: PositionModel = null;
|
||||||
public zoom: number = 1;
|
zoom: number = 1;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public set searchedPosition(position: PositionModel) {
|
public set searchedPosition(position: PositionModel) {
|
||||||
if (!position) return;
|
if (position) {
|
||||||
|
this.position = position;
|
||||||
console.dir(position);
|
this.zoom = 12;
|
||||||
this.position = position;
|
}
|
||||||
this.zoom = 12;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
ngOnInit() {
|
||||||
// set up current location
|
// set up current location
|
||||||
if ('geolocation' in navigator) {
|
if ('geolocation' in navigator) {
|
||||||
navigator.geolocation.getCurrentPosition((position) => {
|
navigator.geolocation.getCurrentPosition((position) => {
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ import { PositionModel } from './entity/position.model';
|
||||||
templateUrl: './search-map.component.html',
|
templateUrl: './search-map.component.html',
|
||||||
})
|
})
|
||||||
export class SearchMapComponent {
|
export class SearchMapComponent {
|
||||||
public searchedPosition: PositionModel = new PositionModel();
|
searchedPosition: PositionModel = new PositionModel();
|
||||||
|
|
||||||
public setPosition(position: PositionModel): void {
|
setPosition(position: PositionModel) {
|
||||||
this.searchedPosition = position;
|
this.searchedPosition = position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ import { PositionModel } from '../entity/position.model';
|
||||||
export class SearchComponent implements OnInit {
|
export class SearchComponent implements OnInit {
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
public readonly positionChanged: EventEmitter<PositionModel> = new EventEmitter<PositionModel>();
|
positionChanged: EventEmitter<PositionModel> = new EventEmitter<PositionModel>();
|
||||||
|
|
||||||
@ViewChild('search', { static: true })
|
@ViewChild('search', { static: true })
|
||||||
public searchElementRef: ElementRef;
|
searchElementRef: ElementRef;
|
||||||
|
|
||||||
constructor(private readonly ngZone: NgZone) {}
|
constructor(private ngZone: NgZone) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const autocomplete = new google.maps.places.Autocomplete(
|
const autocomplete = new google.maps.places.Autocomplete(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue