ionic forum I got a error when i simulate my project in ionic lab what i did was:
i add:
$ ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID=“YOUR_ANDROID_API_KEY_IS_HERE”
then the code is:
import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import {
GoogleMap,
GoogleMapsEvent,
GoogleMapsLatLng,
CameraPosition,
GoogleMapsMarkerOptions,
GoogleMapsMarker
} from ‘ionic-native’;
@Component({
selector: ‘page-contact’,
templateUrl: ‘contact.html’
})
export class ContactPage {
constructor(public navCtrl: NavController) {
}
ngAfterViewInit() {
this.loadMap();
}
loadMap(){
// create a new map by passing HTMLElement
let element: HTMLElement = document.getElementById(‘map’);
let map = new GoogleMap(element);
// create LatLng object
let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
// create CameraPosition
let position: CameraPosition = {
target: ionic,
zoom: 18,
tilt: 30
};
// listen to MAP_READY event
map.one(GoogleMapsEvent.MAP_READY).then(() => {
// move the map’s camera to position
map.moveCamera(position); // works on iOS and Android
});
// create new marker
let markerOptions: GoogleMapsMarkerOptions = {
position: ionic,
title: ‘Ionic’
};
map.addMarker(markerOptions)
.then((marker: GoogleMapsMarker) => {
marker.showInfoWindow();
});
}
}
when i run it on oinic serve --lab i got an error showed at the picture please help me to solve