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

Readme

Keywords

none

Package Sidebar

Install

npm i ng-qqmap

Weekly Downloads

1

Version

0.0.6

License

ISC

Last publish

Collaborators

  • zhiguang