Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

440
Visualizações
Error: Uncaught (in promise): Error: No provider for GoogleMaps

I am using ionic framework but while integrating google maps i am getting this error : Error: Uncaught (in promise): Error: No provider for GoogleMaps!

this is my map class :

     import { Component,ViewChild } from '@angular/core';
      import { NavController,Platform } from 'ionic-angular';
      import { App, MenuController } from 'ionic-angular';
     import {
     GoogleMaps,
    GoogleMap,
    GoogleMapsEvent,   LatLng,
   CameraPosition,
  MarkerOptions,
  Marker
 } from '@ionic-native/google-maps';
 import { HttpModule } from '@angular/http';
 import { NgModule } from '@angular/core';



  @NgModule({
 imports: [
  HttpModule
]})
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {

 map: GoogleMap;
 constructor(public platform: Platform,public navCtrl: 
     NavController,app: App, menu: MenuController,private googleMaps: 
       GoogleMaps) {

     menu.enable(true);
        platform.ready().then(() => {
        this.loadMap();
          });

      }

        @ViewChild('map') mapElement;

// Load map only after view is initialized loadMap(){

       let location = new LatLng(-34.9290,138.6010);

    this.map = new GoogleMap('map', {
      'backgroundColor': 'white',
      'controls': {
        'compass': true,
        'myLocationButton': true,
        'indoorPicker': true,
        'zoom': true
      },
      'gestures': {
        'scroll': true,
        'tilt': true,
        'rotate': true,
        'zoom': true
      },
      'camera': {
        'latLng': location,
        'tilt': 30,
        'zoom': 15,
        'bearing': 50
      }
    });

    this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
        console.log('Map is ready!');
    });

}

}

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You need to add the provider to the NgModule, i.e module.ts under providers,

providers: [
  GoogleMaps
]
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda