Guest User

Untitled

a guest
Dec 10th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public initMap(mapElement: ElementRef, search: ElementRef, options: MapOptions) {
  2. return this.init().pipe(
  3. switchMap(() =>
  4. this.createGoogleMap(mapElement.nativeElement, search.nativeElement, options)
  5. ),
  6. exhaustMap(() =>
  7. forkJoin(
  8. this.subscribeToDrawingEvents('circlecomplete').pipe(
  9. map(d => console.log(d))
  10. ),
  11. this.subscribeToCenterChangeEvents('center_changed').pipe(
  12. map(d => console.log(d))
  13. ),
  14. this.subscribeToRadiusChangeEvents('radius_changed').pipe(
  15. map(d => console.log(d))
  16. ),
  17. this.subscribeToSearchboxEvents('places_changed')
  18. )
  19. )
  20. );
  21.  
  22. ngOnInit() {
  23. this.option = {
  24. center: this.center ? this.center : { lat: 0, lng: 0 },
  25. zoom: this.zoom ? this.zoom : 4,
  26. markers: this.markers ? this.markers : []
  27. };
  28. this.subscribe_event$ = this.service.initMap(this.googleMap, this.searchInput, this.option);
  29. this.subscribe_event$.subscribe();
  30.  
  31. this.subscribeToCenterChangeEvents('center_changed').pipe(
  32. map(d => console.log(d))
  33. ),
Add Comment
Please, Sign In to add comment