2016-05-11 17:38:01 +03:00
|
|
|
import {Component, ViewEncapsulation, ElementRef} from '@angular/core';
|
2016-05-04 11:49:36 +03:00
|
|
|
import {BaCard} from '../../../../theme/components';
|
2016-05-02 16:55:58 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'google-maps',
|
|
|
|
|
pipes: [],
|
|
|
|
|
providers: [],
|
2016-05-02 17:43:45 +03:00
|
|
|
styles: [require('./googleMaps.scss')],
|
|
|
|
|
directives: [BaCard],
|
|
|
|
|
template: require('./googleMaps.html'),
|
2016-05-02 16:55:58 +03:00
|
|
|
})
|
|
|
|
|
export class GoogleMaps {
|
|
|
|
|
|
2016-05-02 17:43:45 +03:00
|
|
|
constructor(private _elementRef:ElementRef) {
|
2016-05-02 16:55:58 +03:00
|
|
|
}
|
|
|
|
|
|
2016-05-02 17:43:45 +03:00
|
|
|
ngAfterViewInit() {
|
2016-05-11 17:38:01 +03:00
|
|
|
let el = this._elementRef.nativeElement.querySelector('.google-maps');
|
2016-05-02 18:17:54 +03:00
|
|
|
|
2016-05-06 19:48:48 +03:00
|
|
|
// TODO: do not load this each time as we already have the library after first attempt
|
2016-05-02 17:43:45 +03:00
|
|
|
GoogleMapsLoader.load((google) => {
|
2016-05-02 18:17:54 +03:00
|
|
|
new google.maps.Map(el, {
|
2016-05-02 17:43:45 +03:00
|
|
|
center: new google.maps.LatLng(44.5403, -78.5463),
|
|
|
|
|
zoom: 8,
|
|
|
|
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-05-02 16:55:58 +03:00
|
|
|
}
|