Replace @agm/core with @angular/google-maps

This commit is contained in:
eugene-sinitsyn 2020-03-03 17:23:14 +03:00 committed by Maksim Karatkevich
parent 8d749466f9
commit 7c34bd2966
5 changed files with 26 additions and 23 deletions

View file

@ -3,19 +3,8 @@ import { Component } from '@angular/core';
@Component({
selector: 'ngx-gmaps',
styleUrls: ['./gmaps.component.scss'],
template: `
<!-- <nb-card>
<nb-card-header>Google Maps</nb-card-header>
<nb-card-body>
<agm-map [latitude]="lat" [longitude]="lng">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>
</nb-card-body>
</nb-card> -->
`,
templateUrl: './gmaps.component.html'
})
export class GmapsComponent {
lat = 51.678418;
lng = 7.809007;
public readonly position = { lat: 51.678418, lng: 7.809007 };
}

View file

@ -1,5 +1,5 @@
import { NgModule } from '@angular/core';
// import { AgmCoreModule } from '@agm/core';
import { GoogleMapsModule } from '@angular/google-maps';
import { LeafletModule } from '@asymmetrik/ngx-leaflet';
import { NgxEchartsModule } from 'ngx-echarts';
import { NbCardModule } from '@nebular/theme';
@ -10,10 +10,7 @@ import { MapsRoutingModule, routedComponents } from './maps-routing.module';
@NgModule({
imports: [
ThemeModule,
// AgmCoreModule.forRoot({
// apiKey: 'AIzaSyCpVhQiwAllg1RAFaxMWSpQruuGARy0Y1k',
// libraries: ['places'],
// }),
GoogleMapsModule,
LeafletModule.forRoot(),
MapsRoutingModule,
NgxEchartsModule,

View file

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon.png">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCpVhQiwAllg1RAFaxMWSpQruuGARy0Y1k&libraries=places"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCpVhQiwAllg1RAFaxMWSpQruuGARy0Y1k"></script>
</head>
<body>
<ngx-app>Loading...</ngx-app>