I'm currently following a tutorial on YouTube about integrating Google Maps into Ionic. I encountered an error that I'm struggling to understand. Whenever I try to run the app, I receive the following error:
Check out the tutorial video here: https://www.youtube.com/watch?v=jD5yYX1KWXA
Typescript Error:
The argument of type '{}' is not compatible with the parameter of type 'GoogleMapOptions'. The property 'mapType' is missing in the type '{}'.
This error is being thrown in home.ts file.
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { GoogleMap, GoogleMaps, LatLng, CameraPosition, GoogleMapsEvent, MarkerOptions, Marker } from '@ionic-native/google-maps';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController, public googleMaps: GoogleMaps) {}
ngAfterViewInit() {
this.loadMap();
}
loadMap() {
let element = document.getElementById('map');
let map: GoogleMap = this.googleMaps.create(element, {});
}
}
The issue seems to be at .....(element, {});
I am having trouble figuring out why I can't simply pass an empty object as an argument.
By the way, I'm fairly new to working with Ionic.