Next Phenomenal Microbrewery

    angular2-baidu-map
    TypeScript icon, indicating that this package has built-in type declarations

    8.1.1 • Public • Published

    angular2-baidu-map

    NPM version

    Baidu-Map module for Angular8

    Read full documentation here: documentation

    Read code example here: example

    Be aware that it is a totally rewrite version, therefore, backward compatibility is not considered

    Getting started

    npm install angular2-baidu-map

    Usage

    app.module.ts

    import { BrowserModule } from '@angular/platform-browser'
    import { NgModule } from '@angular/core'
     
    import { AppComponent } from './app.component'
     
    import { BaiduMapModule } from 'angular2-baidu-map'
     
    @NgModule({
      declarations: [AppComponent],
      imports: [BrowserModule, BaiduMapModule.forRoot({ ak: 'your ak' })],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule {}

    app.component.ts

    import { Component } from '@angular/core'
     
    import { MapOptions } from 'angular2-baidu-map'
     
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: []
    })
    export class AppComponent {
      options: MapOptions
     
      constructor() {
        this.options = {
          centerAndZoom: {
            lat: 39.920116,
            lng: 116.403703,
            zoom: 16
          },
          enableKeyboard: true
        }
      }
    }

    app.component.html

    <baidu-map [options]="options" style="display: block; width: 550px; height: 350px;"></baidu-map>

    For more information, see documentation

    LICENSE

    GPL License

    Keywords

    none

    Install

    npm i angular2-baidu-map

    DownloadsWeekly Downloads

    217

    Version

    8.1.1

    License

    none

    Unpacked Size

    1.05 MB

    Total Files

    149

    Last publish

    Collaborators

    • howard.zuo