mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-03-10 15:42:34 +01:00
Remove packages uncompatible with Ivy
This commit is contained in:
parent
b60471c100
commit
bb1a759acf
14 changed files with 246 additions and 50 deletions
|
|
@ -1,3 +1,7 @@
|
|||
<google-map [center]="position" [zoom]="zoom" width="100%" height="36.5625rem">
|
||||
<map-marker [position]="position"></map-marker>
|
||||
</google-map>
|
||||
<!-- <agm-map [latitude]="latitude"
|
||||
[longitude]="longitude"
|
||||
[scrollwheel]="false"
|
||||
[zoom]="zoom">
|
||||
<agm-marker [latitude]="latitude"
|
||||
[longitude]="longitude"></agm-marker>
|
||||
</agm-map> -->
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { Component, ElementRef, EventEmitter, NgZone, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { PositionModel } from '../entity/position.model';
|
||||
// import { MapsAPILoader } from '@agm/core';
|
||||
import { Location } from '../entity/Location';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-search',
|
||||
|
|
@ -7,34 +9,36 @@ import { PositionModel } from '../entity/position.model';
|
|||
})
|
||||
export class SearchComponent implements OnInit {
|
||||
|
||||
@Output()
|
||||
positionChanged: EventEmitter<PositionModel> = new EventEmitter<PositionModel>();
|
||||
@Output() positionChanged = new EventEmitter<Location>();
|
||||
|
||||
@ViewChild('search', { static: true })
|
||||
searchElementRef: ElementRef;
|
||||
public searchElementRef: ElementRef;
|
||||
|
||||
constructor(private ngZone: NgZone) {}
|
||||
constructor(// private mapsAPILoader: MapsAPILoader,
|
||||
private ngZone: NgZone) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const autocomplete = new google.maps.places.Autocomplete(
|
||||
this.searchElementRef.nativeElement, { types: ['address'] },
|
||||
);
|
||||
// load Places Autocomplete
|
||||
// this.mapsAPILoader.load().then(() => {
|
||||
// const autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, {
|
||||
// types: ['address'],
|
||||
// });
|
||||
// autocomplete.addListener('place_changed', () => {
|
||||
// this.ngZone.run(() => {
|
||||
// // get the place result
|
||||
// const place: google.maps.places.PlaceResult = autocomplete.getPlace();
|
||||
|
||||
autocomplete.addListener('place_changed', () => {
|
||||
this.ngZone.run(() => {
|
||||
// get the place result
|
||||
const place: google.maps.places.PlaceResult = autocomplete.getPlace();
|
||||
// // verify result
|
||||
// if (place.geometry === undefined || place.geometry === null) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// verify result
|
||||
if (place.geometry === undefined || place.geometry === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.positionChanged.emit(new PositionModel(
|
||||
place.geometry.location.lat(),
|
||||
place.geometry.location.lng(),
|
||||
));
|
||||
});
|
||||
});
|
||||
// this.positionChanged.emit(
|
||||
// new Location(place.geometry.location.lat(),
|
||||
// place.geometry.location.lng()));
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue