google maps

This commit is contained in:
nixa 2016-05-02 17:43:45 +03:00
parent a182cb00ca
commit 6cf83c8903
6 changed files with 27 additions and 6 deletions

View file

@ -1,19 +1,30 @@
import {Component, ViewEncapsulation} from 'angular2/core';
import {Component, ViewEncapsulation, ElementRef} from 'angular2/core';
import {BaCard} from '../../../../theme';
import {DOM} from "angular2/src/platform/dom/dom_adapter";
@Component({
selector: 'google-maps',
pipes: [],
providers: [],
styles: [],
template: 'googleMaps'
styles: [require('./googleMaps.scss')],
directives: [BaCard],
template: require('./googleMaps.html'),
})
export class GoogleMaps {
constructor() {
constructor(private _elementRef:ElementRef) {
}
ngOnInit() {
console.log('googleMaps');
}
ngAfterViewInit() {
GoogleMapsLoader.load((google) => {
new google.maps.Map(DOM.querySelector(this._elementRef.nativeElement, '.google-maps'), {
center: new google.maps.LatLng(44.5403, -78.5463),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
});
}
}