1.0.9 • Published 6 years ago

com.zdk.locationcordovaplugin v1.0.9

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

###com.zdk.locationcordovaplugin

 高德地图的cordova插件,30s发送一次定位信息到服务器。

 插件要求:
   1.cordova-android >= 6
   2.cordova-plugman >= 5.2

###安装和卸载

   ionic cordova plugin add com.zdk.locationcordovaplugin --variable ANDROID_API_KEY=private_app_id
   ionic cordova plugin remove com.zdk.locationcordovaplugin #卸载

ionic3中插件集成

import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';

@Plugin({
  pluginName: 'MSZDKAMapPlugin',
  plugin: 'com.zdk.locationcordovaplugin',
  pluginRef: 'ZDKAMapPlugin',
  platforms: ['Android']
})

@Injectable()
export class MSZDKAMapPlugin extends IonicNativePlugin {
  @Cordova({
    observable: true,
  })
  startLocation(): Observable<any> { return; }


  @Cordova({
    callbackOrder: 'reverse'
  })
  configure(userToken: string): Promise<string> {return ;}
}

使用说明

   1. startLocation() 代表注册服务
      在app.component.ts中使用,只初始化一次,每60s插件会返回最新的位置信息。
      eg: startLocation().subscribe( msg => {
            alert(msg.longitude);
            alert(msg.latitude);
        }, error => {

        })


   2.handlerLocation() 主动向插件发起定位申请,插件的返回值会传递到 startLocation()的监听中。
     @Cordova()
     handlerLocation(): Observable<any> { return; }

   3. configure() 更改用户的token
      退出时 configure('')
      登录时 configure('xxxx')
1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago