1.0.2 • Published 5 months ago

@charer/react-native-tencentmap-geolocation v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-native-tencentmap-geolocation

腾讯地图定位react-native组件

安装

npm install @charer/react-native-tencentmap-geolocation

Usage

import { addLocationListener,removeLocationListener,setRequestLevel,stop,requestSingleLocation } from '@charer/react-native-tencentmap-geolocation';


// 设置定位级别
setRequestLevel(1)
// 添加监听函数
this.listen = addLocationListener((r)=>{
console.log('定位信息',r)
})
// 请求单次定位
requestSingleLocation(true);

注意

页面销毁时必须移除监听,否则会导致多次监听,有溢出风险 本模块基于react-native 0.61.5版本调试,其他版本未进行测试,如需使用请自行完善

感谢

本项目参考 qiuxiang/react-native-amap-geolocation 搭建,感谢大佬

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago