Hi i am following a youtube video on how to implement Google Maps into ionic. I have this error that i don't understand. When i run the app i got this error:
Link to video: https://www.youtube.com/watch?v=jD5yYX1KWXA
Typescript Error:
Argument of type '{}' is not assignable to parameter of type 'GoogleMapOptions'. Property 'mapType' is missing in type '{}'.
home.ts
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 error is pointing at .....(element, {});
i simply can't put {}.
btw im still new to ionic
If you don't want to pass any option to the map, just omit that parameter like this:
loadMap() {
let element = document.getElementById('map');
let map: GoogleMap = this.googleMaps.create(element);
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments