mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-20 09:20:12 +01:00
google maps
This commit is contained in:
parent
a182cb00ca
commit
6cf83c8903
6 changed files with 27 additions and 6 deletions
|
|
@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue