Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public initMap(mapElement: ElementRef, search: ElementRef, options: MapOptions) {
- return this.init().pipe(
- switchMap(() =>
- this.createGoogleMap(mapElement.nativeElement, search.nativeElement, options)
- ),
- exhaustMap(() =>
- forkJoin(
- this.subscribeToDrawingEvents('circlecomplete').pipe(
- map(d => console.log(d))
- ),
- this.subscribeToCenterChangeEvents('center_changed').pipe(
- map(d => console.log(d))
- ),
- this.subscribeToRadiusChangeEvents('radius_changed').pipe(
- map(d => console.log(d))
- ),
- this.subscribeToSearchboxEvents('places_changed')
- )
- )
- );
- ngOnInit() {
- this.option = {
- center: this.center ? this.center : { lat: 0, lng: 0 },
- zoom: this.zoom ? this.zoom : 4,
- markers: this.markers ? this.markers : []
- };
- this.subscribe_event$ = this.service.initMap(this.googleMap, this.searchInput, this.option);
- this.subscribe_event$.subscribe();
- this.subscribeToCenterChangeEvents('center_changed').pipe(
- map(d => console.log(d))
- ),
Add Comment
Please, Sign In to add comment