Skip to content

Instantly share code, notes, and snippets.

@geykel

geykel/demoGoogleMaps-home.ts Secret

Last active Aug 10, 2017
Embed
What would you like to do?
import { Component, ViewChild, ElementRef } from '@angular/core';
import { GoogleMaps } from '../../providers/google-maps/google-maps';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild('map') mapElement: ElementRef;
constructor(public maps: GoogleMaps) {
}
ionViewDidLoad() {
this.maps.init(this.mapElement.nativeElement, (latLng) => {
console.log(latLng.lat() + ', ' + latLng.lng());
}).then(() => {
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment