NIM : 1729042068
DOSEN PENGAMPU :
FAKULTAS TEKNIK
2019
TAMPILAN APP RATE, SHARE, MAPS
Berikut beberapa tampilan pembaharuan Ionic App:
1. Pertama-tama jalankan CMD, kemudian jalankan perintah ionic serve.
2. Setelah ionic app seleai tercompile maka web browser akan terbuka sendiri kemudian akan
tampil tampilan seperti berikut:
@Component({
selector: 'app-maps',
templateUrl: './maps.page.html',
styleUrls: ['./maps.page.scss'],
})
export class MapsPage {
map: any;
infoWindow: any;
alamat:string;
@ViewChild('map') mapElement: ElementRef;
ngOnInit(){
this.initMap();
}
initMap(){
this.geolocation.getCurrentPosition().then((position) =>{
let latLng = new google.maps.LatLng(position.coords.latitude,
position.coords.longitude);
let mapOptions = google.maps.MapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.nativeGeocoder.reverseGeocode(position.coords.latitude,
position.coords.longitude)
.then((result: NativeGeocoderReverseResult[]) => this.alamat =
(JSON.stringify(result[0])))
.catch((error: any)=> console.log(error));
google.maps.event.addListener(marker,'click', ()=> {
this.infoWindow.open(this.map,marker);
});
},(err) => {
console.log(err);
});
}
}
g. Berikut adalah tampilan maps di page maps pada emulator web