aruis / cordova-plugin-baidumaplocation

Get device current Location from Baidu Map
https://www.npmjs.com/package/cordova-plugin-baidumaplocation
Apache License 2.0
139 stars 69 forks source link

@ionic-native插件添加 #71

Open qdu123 opened 5 years ago

qdu123 commented 5 years ago

一、ionic可以添加ionic-native组件,直接在angular中使用 1.git clone https://github.com/ionic-team/ionic-native.git 2.npm install 3.gulp plugin:create -n BaiduLocation 4.编辑ionic-native/src/@ionic-native/plugins/baidu-location/index.ts import { Injectable } from '@angular/core'; import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs';

@Plugin({ pluginName: 'BaiduLocation', plugin: 'cordova-plugin-baidumaplocation', // npm package name, example: cordova-plugin-camera pluginRef: 'cordova.plugins.baidumap_location', // the variable reference to call the plugin, example: navigator.geolocation repo: 'https://github.com/aruis/cordova-plugin-baidumaplocation.git', // the github repository URL for the plugin install: 'ionic cordova plugin add https://github.com/aruis/cordova-plugin-baidumaplocation.git --variable ANDROID_KEY=your android key --variable IOS_KEY=your ios key', // OPTIONAL install command, in case the plugin requires variables installVariables: ['ANDROID_KEY' , 'IOS_KEY'] , // OPTIONAL the plugin requires variables platforms: ['Android' , 'iOS'] // Array of platforms supported, example: ['Android', 'iOS'] }) @Injectable() export class BaiduLocation extends IonicNativePlugin {

/**

}

export interface PositionOptions { time: string ; locType: string ; locTypeDescription: string ; latitude: number ; longitude: number ; countryCode: string ; country: string ; province: string ; citycode: string ; city: string ; district: string ; street: string ; addr: string ; }

5.npm run build 6.复制生成的dist/@ionic-native/baidu-location到项目下/node_modules/@ionic-native/ 7.在package中添加@ionic-native/baidu-location依赖

qdu123 commented 5 years ago

话说怎么提交到官方去