Google Maps Native Map Type


#1

How do I set the mapType using Ionic 2 and google maps native

import {
 GoogleMaps,
 GoogleMap,
 GoogleMapsEvent,
 GoogleMapOptions,
 CameraPosition,
 MarkerOptions,
 Marker
} from '@ionic-native/google-maps';



constructor(public navCtrl: NavController, public googleMaps: GoogleMaps) { }


    let mapOptions: GoogleMapOptions = {
      camera: {
        target: {
          lat: 43.0741904,
          lng: -89.3809802
        },
        zoom: 18,
        tilt: 30
      },
      'mapType': this.googleMaps.MapTypeId.ROADMAP
    };

Error:Property 'MapTypeId' does not exist on type 'GoogleMaps'.

From the documentation it states map.setMapTypeId(plugin.google.maps.MapTypeId.HYBRID); But I can’t figure out what type plugin is?


#2

#3

Awesome thanks! Do you think it is worth it to make a pr to improve the docs? Or is it just me with this problem. Probably just me :grinning:


#4

Please tell me how did you fix it? which code and where to put it?

thank you


#5
let mapOptions: GoogleMapOptions = {
  camera: {
    target: {
      lat: 43.0741904,
      lng: -89.3809802
    },
    zoom: 18,
    tilt: 30
  },
  'mapType': 'MAP_TYPE_HYBRID'
};

@solucionesmipc Hope that helps