2.6.2 • Published 6 years ago

ng4-baidu-map v2.6.2

Weekly downloads
31
License
4.0
Repository
github
Last release
6 years ago

ng4-baidu-map

NPM version

Baidu-Map module for Angular4

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 ng4-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 'ng4-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 'ng4-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>
2.6.2

6 years ago

2.6.1

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.3.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago