Consuming your library
$ npm i angular-googlemaps --save
and then from your Angular AppModule
:
;; ; // Import this library;;//End import
Once your library is imported, you can use its components:
import { Component } from '@angular/core'; // Import your Service and Modelimport { GoogleMapsConfig } from 'angular-googlemaps'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css']}) export class AppComponent { //set your lat and lng lat: number = -23.586479;lng: number = -46.682078; //Set your google Key here constructor(private googleMapsConfig: GoogleMapsConfig) { this.googleMapsConfig.getApiKey('Your Key'); } }
Now We need to call the directives in our html:
License
MIT © Thiago da Silva Adriano