本文整理汇总了TypeScript中google-maps.load函数的典型用法代码示例。如果您正苦于以下问题:TypeScript load函数的具体用法?TypeScript load怎么用?TypeScript load使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ngAfterViewInit
ngAfterViewInit() {
let el = this._elementRef.nativeElement.querySelector('.google-maps');
// TODO: do not load this each time as we already have the library after first attempt
GoogleMapsLoader.load((google) => {
new google.maps.Map(el, {
center: new google.maps.LatLng(33.5055259, -112.07474560000003),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
});
}
示例2: ngAfterViewInit
ngAfterViewInit(): void{
let el = this._elementRef.nativeElement.querySelector('.google-maps');
// TODO: do not load this each time as we already have the library after first attempt
GoogleMapsLoader.load((google) => {
this.google = google;
this.map = new google.maps.Map(el, {
center: new google.maps.LatLng(33.5055259, -112.07474560000003),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
this.icons = {
user: {
icon: "https://maps.gstatic.com/intl/en_us/mapfiles/markers2/measle_blue.png"
},
last: {
icon: "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"
}
};
this.getDots();
});
}