Typescript Error: Property 'mapType' is missing in type '{}'

Suresh

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

sebaferreras

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Typescript error: Property 'children' is missing in type but required in type 'CommonProps'

From Dev

React + Typescript: Property * is missing in type *

From Dev

Typescript error: A private property is missing?

From Dev

TypeScript ReactDOM Property 'type' is missing on component

From Dev

React with Typescript: property map is missing for type

From Dev

Typescript error: Property '0' is missing in number[]

From Dev

Typescript Material UI Property 'classes' is missing in type for MUI component

From Dev

React-Navigation and TypeScript. Property 'getScreen' is missing in type

From Dev

Declaring object of arrays in Typescript; getting error Type '{}' missing the following properties

From Dev

Declaring object of arrays in Typescript; getting error Type '{}' missing the following properties

From Dev

Typescript compile error: Property 'classList' does not exist on type 'Node'

From Dev

How to avoid typescript error: Property 'innerHTML' does not exist on type 'Element'

From Dev

Typescript error: Property 'value' does not exist on type 'Observable<any>'

From Java

useRef Typescript error: Property 'current' does not exist on type 'HTMLElement'

From Dev

Public property of exported class is using private type error in TypeScript

From Dev

Typescript Error TS2339: Property 'project' does not exist on type '{}'

From Dev

Typescript compile error: Property 'bodyParser' does not exist on type 'typeof e'

From Dev

TypeScript Build Error : Property does not exist on type 'IStateParamsService'

From Dev

Typescript Directives error "Property IScope dont exist on type 'IAngularStatic"

From Dev

TypeScript throws error "Property 'breadcrumb' does not exist on type 'Data'."

From Dev

Ionic TypeScript Error (Property 'nav' does not exist on type 'HomePage')

From Dev

Ionic 3 TypeScript Error - Property 'then' does not exist on type 'void'

From Dev

Typescript error Property does not exist on type 'HTMLElement'. any

From Dev

Property 'XYZ' is missing in type CustomModel[]

From Dev

Error: missing type specifier

From Dev

Typescript: Index signature is missing in type

From Dev

Typescript conditional type missing properties

From Dev

TypeScript React Functional Component - is missing the following properties from type 'Element': type, props, key error

From Java

JavaScript type script Property 0 is missing in type []

Related Related

  1. 1

    Typescript error: Property 'children' is missing in type but required in type 'CommonProps'

  2. 2

    React + Typescript: Property * is missing in type *

  3. 3

    Typescript error: A private property is missing?

  4. 4

    TypeScript ReactDOM Property 'type' is missing on component

  5. 5

    React with Typescript: property map is missing for type

  6. 6

    Typescript error: Property '0' is missing in number[]

  7. 7

    Typescript Material UI Property 'classes' is missing in type for MUI component

  8. 8

    React-Navigation and TypeScript. Property 'getScreen' is missing in type

  9. 9

    Declaring object of arrays in Typescript; getting error Type '{}' missing the following properties

  10. 10

    Declaring object of arrays in Typescript; getting error Type '{}' missing the following properties

  11. 11

    Typescript compile error: Property 'classList' does not exist on type 'Node'

  12. 12

    How to avoid typescript error: Property 'innerHTML' does not exist on type 'Element'

  13. 13

    Typescript error: Property 'value' does not exist on type 'Observable<any>'

  14. 14

    useRef Typescript error: Property 'current' does not exist on type 'HTMLElement'

  15. 15

    Public property of exported class is using private type error in TypeScript

  16. 16

    Typescript Error TS2339: Property 'project' does not exist on type '{}'

  17. 17

    Typescript compile error: Property 'bodyParser' does not exist on type 'typeof e'

  18. 18

    TypeScript Build Error : Property does not exist on type 'IStateParamsService'

  19. 19

    Typescript Directives error "Property IScope dont exist on type 'IAngularStatic"

  20. 20

    TypeScript throws error "Property 'breadcrumb' does not exist on type 'Data'."

  21. 21

    Ionic TypeScript Error (Property 'nav' does not exist on type 'HomePage')

  22. 22

    Ionic 3 TypeScript Error - Property 'then' does not exist on type 'void'

  23. 23

    Typescript error Property does not exist on type 'HTMLElement'. any

  24. 24

    Property 'XYZ' is missing in type CustomModel[]

  25. 25

    Error: missing type specifier

  26. 26

    Typescript: Index signature is missing in type

  27. 27

    Typescript conditional type missing properties

  28. 28

    TypeScript React Functional Component - is missing the following properties from type 'Element': type, props, key error

  29. 29

    JavaScript type script Property 0 is missing in type []

HotTag

Archive