To get the angular2-google-map now called @agm/core working it is important to update the selector tags. The author has not yet updated the docs (in this moment of the post).
BEFORE last update:
npm install angular2-google-maps --save
<sebm-google-map [latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="lat" [longitude]="lng"></sebm-google-map-marker>
</sebm-google-map>
NOW after latest update
npm install @agm/core --save
<sebm-google-map [latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="lat" [longitude]="lng"></sebm-google-map-marker>
</sebm-google-map>
Example setup:
file: google-maps.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-google-maps',
templateUrl: './google-maps.component.html',
styleUrls: ['./google-maps.component.css'],
})
export class GoogleMapsComponent implements OnInit {
lat: number = 51.678418;
lng: number = 7.809007;
constructor() { }
ngOnInit() {
}
}
file: google-maps.component.html
<agm-map [latitude]="lat" [longitude]="lng">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>
file: google-maps.component.css
.sebm-google-map-container {
height: 300px;
}
file: app.module.ts
import { AgmCoreModule } from '@agm/core';
@NgModule({imports: [AgmCoreModule.forRoot()}]]