ng-qqmap

0.0.6 • Public • Published

介绍

利用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 );
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.61latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.61
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i ng-qqmap

Weekly Downloads

1

Version

0.0.6

License

ISC

Last publish

Collaborators

  • zhiguang