本文整理匯總了TypeScript中ionic-native.GoogleMap.on方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript GoogleMap.on方法的具體用法?TypeScript GoogleMap.on怎麽用?TypeScript GoogleMap.on使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ionic-native.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.on方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: loadMap
loadMap(){
let location = new GoogleMapsLatLng(-34.9290,138.6010);
this.map = new GoogleMap('map', {
'backgroundColor': 'white',
'controls': {
'compass': true,
'myLocationButton': true,
'indoorPicker': true,
'zoom': true
},
'gestures': {
'scroll': true,
'tilt': true,
'rotate': true,
'zoom': true
},
'camera': {
'latLng': location,
'tilt': 30,
'zoom': 15,
'bearing': 50
}
});
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
console.log('Map is ready!');
});
}
示例2: loadMap
loadMap(){
let location = new GoogleMapsLatLng(-34.9290,138.6010);
//-34.9290,138.6010
this.map = new GoogleMap('map', {
'backgroundColor': 'white',
'controls': {
'compass': true,
'myLocationButton': true,
'indoorPicker': true,
'zoom': true
},
'gestures': {
'scroll': true,
'tilt': true,
'rotate': true,
'zoom': true
},
'camera': {
'latLng': location,
'tilt': 30,
'zoom': 15,
'bearing': 50
}
});
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
console.log('Map is ready!');
console.log(this.lat + ' ' + this.long);
Geolocation.getCurrentPosition().then(pos => {
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
this.lat = pos.coords.latitude;
this.long = pos.coords.longitude;
let coord = new GoogleMapsLatLng(this.lat, this.long);
this.map.setCenter(coord);
//this.map.animateCamera({
// 'target': coord,
// 'tilt': 60,
// 'zoom': 18,
// 'bearing': 140
//});
this.map.addMarker({
'position':coord,
'title': "The TagOn Project HeadQuarters"}).then(marker => {
marker.addEventListener(GoogleMapsEvent.INFO_CLICK).subscribe(() => {
console.log("Info window was clicked");
});
});
});
});
}
示例3: onPlatformReady
private onPlatformReady(): void {
this.map = new GoogleMap('map');
this.map.on(GoogleMapsEvent.MAP_READY)
.subscribe(() => this.onMapReady());
}
示例4: constructor
constructor(){
let map = new GoogleMap('googleMap');
map.on(GoogleMapsEvent.MAP_READY).subscribe(() => console.log("Map is ready!"));
}