0.0.6 • Published 7 years ago

ng-qqmap v0.0.6

Weekly downloads
10
License
ISC
Repository
github
Last release
7 years ago

介绍

利用Angular模块封装的QQ地图API

安装

npm install ng-qqmap --save

使用

app.module.ts

import { NgQQMapModule } from 'ng-qqmap';


@NgModule({
  imports: [
    ...
    NgQQMapModule.forRoot('你的KEY'),
  ],

API

范例

import { Component, ViewChild, AfterViewInit }  from '@angular/core';
import { NgQQMap } from 'ng-qqmap';

@Component({
  selector: 'qq-map-component',
  template: `<div #container style="width:500px;height:300px;"></div>
      <button (click)="map()">Creaete</button>`,
})
export class QQMapComponent implements AfterViewInit {
  constructor(
    private qqMap: NgQQMap
  ) {}

  @ViewChild( 'container' ) container:any;

  ngAfterViewInit() {
    let map = this.qqMap.Map( this.container.nativeElement );
    console.log( map );
  }
}
0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago