I'm currently working on integrating AGM into my Ionic 2 project.
app.module.ts
...
import { AgmCoreModule } from '@agm/core';
import { DirectionsMapDirective } from '../components/directions-map';
@NgModule({
declarations: [
MyApp,
...
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
AgmCoreModule.forRoot({
apiKey: '<api key>',
libraries: ['places']
})
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
...
],
providers: [
StatusBar,
SplashScreen,
DirectionsMapDirective,
{ provide: ErrorHandler, useClass: IonicErrorHandler }
]
})
export class AppModule {}
map.ts
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-requests',
templateUrl: 'requests.html'
})
export class MapPage {
lat: number = 51.678418;
lng: number = 7.809007;
constructor(public navCtrl: NavController) {}
}
map.html
<ion-content>
<sebm-google-map [latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="lat" [longitude]="lng"></sebm-google-map-marker>
</sebm-google-map>
</ion-content>
Upon execution, I encounter the following error:
Template parse errors: Can't bind to 'latitude' since it isn't a known property of 'sebm-google-map'.